嗨,C#中有一个串口组件,有关以太网端口或USB端口,我该如何使用? [英] Hi , there is a component for serial port in C# , what about ethernet port or usb port , how can I use these?

查看:93
本文介绍了嗨,C#中有一个串口组件,有关以太网端口或USB端口,我该如何使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

there is a component for serial port in C# , what about ethernet port or usb port , how can i use these?





我尝试了什么:



C#中有串口组件,以太网端口或usb端口怎么样,我怎么用这些?



What I have tried:

there is a component for serial port in C# , what about ethernet port or usb port , how can i use these?

推荐答案

串口是愚蠢的。以太网和USB具有protocole,因此您需要以适当的格式发送数据。对于以太网,.NET中有一些类来发送和接收数据。



请参阅TcpClient TcpClient类(System.Net.Sockets) [ ^ ]。如果您需要更多示例,请使用Google。



对于USB,我不知道...如果您想通过USB发送串行数据(USB串行适配器) ,然后它将作为串口被威胁。
A serial port is dumb. Ethernet and USB have protocole and thus you need to send data in appropriate format. For Ethernet, there are classes in .NET to send and receive data.

See TcpClient TcpClient Class (System.Net.Sockets)[^]. Use Google if you need more examples.

For USB, I don't know... If you want to send serial data over USB (USB-serial adapter), then it would be threated as a serial port.


这篇关于嗨,C#中有一个串口组件,有关以太网端口或USB端口,我该如何使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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