与网络设备对话
我的网络上有一个设备,我需要使用 C# 从中获取数据。我知道我必须在 C# 中使用套接字,但是有人知道有任何程序可以让我尝试从此设备发送和接收数据吗?例如,根据我拥有的一些非常模糊的文档,我可以向设备传递一个二进制数,它会给我发回一个结果。有没有什么软件可以让我测试这个?谢谢
I have a device on my network that I need to get data out of using C#. I know I have to use sockets within C# but does anyone know of any program that lets me trial sending and receiving data from this device. For example going by some very vague documentation i have, i can pass the device a binary number and it will send me back a result. Is there any software which will let me test this?? Thankyou
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个问题感觉有点模糊,但我希望这是一个可以接受的答案:
您需要获得有关协议的更多信息。对于我自己来说,在收集了我所知道的信息后,我通常会在 Linqpad 中编写一个小脚本来制作数据包并记录响应。
使用第三方软件来监听响应可能会有所帮助,例如wireshark / microsoft网络监视器。此外,仅听设备的声音就可以帮助完成此过程,您可以使用前面提到的wireshark 或MNM 来完成此操作。为了最有效,您需要使用集线器或网络 Tee 监听流量。
玩得开心。
The question felt a bit vague, but here goes with what I hope will be an acceptable answer:
You'll need to get some more information on the protocol. For myself, after I've gathered what information I know, I usually write a small script in Linqpad in order to craft packets and record responses.
It might help to use a third party software to listen to the responses, like wireshark / microsoft network monitor. Also, just listening to the devices chatter can help with the process, and you can do this with the aforementioned wireshark or MNM. In order to be most effective, you'll need to be listening to the traffic using a hub or network tee.
Have fun.
如果您使用的是 Unix,请使用 Net Cat(缩写为 nc): http://en.wikipedia.org/wiki /Netcat
它允许您对网络客户端/服务器软件进行简单的测试(例如将数据从文件发送到套接字或侦听套接字并用文件中的一些数据进行响应)。网络协议开发人员的绝佳工具。
当然,还可以使用 Wireshark/tcpdump 来嗅探和重放网络活动。
请更具体地提出有关操作系统和任务的问题。
If you are on Unix use Net Cat (abbreviated to nc): http://en.wikipedia.org/wiki/Netcat
It allows you to do simple tests of network client/server software (such as send data from file to the socket or listen socket an respond with some data from a file). Great tool for network protocol developers.
And of course, Wireshark/tcpdump to sniff and replay network activity.
Be more specific in your question about the OS and your task.