简体   繁体   English

在C#中管理串口

[英]Managing serial ports in C#

Does anyone know the easiest way to control a serial port in c# (eg set baud rate, data bits, stop bits, read inbound messages in bytes, push outbound messages in bytes,...etc)? 有谁知道在c#中控制串口的最简单方法(例如设置波特率,数据位,停止位,以字节为单位读取入站消息,以字节为单位推出出站消息等)? Are there any ready classes that I can utilize for this? 我可以使用哪些现成的课程吗?

You can do all this with the System.IO.SerialPort class. 您可以使用System.IO.SerialPort类完成所有这些操作。 (so long as you're using >NET 2.0 or above.) (只要您使用的是> NET 2.0或更高版本。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM