设备ping和led闪烁问题 [英] Device pinging and led blink problem

查看:68
本文介绍了设备ping和led闪烁问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ping设备的以太网端口的功能

如果ping成功,c#表单上的绿色指示出现

但是当我想测试另一个端口时,那么我不能ping / b


因为我需要更改pc ip地址准备或重置当前ip地址

以防止错误的ip分配到pc

端口ip正在使用另一个函数,让我们说它是172.3.2.1然后将pc.ip设置为172.3.2.3以便能够ping端口

但是当我从那个端口拔下并将eth canle连接到另一个拥有172.3.3.1的人时,我想将ip ip更改为无关的ip,如3.4.5.6每当我拔掉电缆时(恰好在那一刻使用事件处理程序)

然后我会等待pc ip更改功能将pc ip设置为172.3.3.3



我尝试了什么:



我已经尝试过上面提到的但是失败的事情。请解决此问题。

I have a function which pings ethernet ports of a device
if ping successful , green indication on c# form appears
but when i want to test another port, then i can not ping

because i need to change pc ip address to be prepared or reset current ip address
to prevent wrong ip assignment to pc
port ip is being taken with another function and lets say it is 172.3.2.1 then pc.ip is set as 172.3.2.3 to be able to ping port
but when i unplugged from that port and connect eth canle to another one having 172.3.3.1 then i want to change pc ip to an unrelated ip like 3.4.5.6 whenever i unplug cable (at exactly that moment using event handler)
then i ll wait pc ip change function to set pc ip to 172.3.3.3

What I have tried:

I have tried above things which I have told above but got failure. Please give a resolution to this.

推荐答案

您无法ping到特定端口,ping只能访问IP地址。您所描述的是对设备的套接字访问。首先,您需要找出要发送到设备的消息,这将使LED闪烁。然后你只需编写一个程序来发送这些消息并处理任何响应。 Google会为您找到大量的.NET套接字代码示例。
You cannot ping to a specific port, ping goes only to the IP address. What you are describing is socket access to a device. So first you need to find out what messages to send to the device which will blink the LED. Then you just need to write a program to send those messages and deal with any responses. There are plenty of samples of .NET socket code that Google will find for you.


这篇关于设备ping和led闪烁问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆