SerialPort配置C# [英] SerialPort configuration C#

查看:94
本文介绍了SerialPort配置C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果这是一个愚蠢的问题,请原谅我,但是自从我玩串口通信以来已经有一段时间了。


我正在使用.NET 2.0 SerialPort类。我希望能够在端口上设置CTS,DCD,DSR和RI(环线指示器)之类的东西。我知道如何启用/禁用DTR和RTS,但我找不到任何方法来更改任何其他设置,理想情况下我希望能够进行低级IOCTL设置...


非常感谢任何帮助。



-David -

解决方案

试试这个:



serialport.Close();


serialport.Dispose();




Please forgive me if this is a silly question, but it's been a while since I've played with Serial Port communication.

I'm using the .NET 2.0 SerialPort class. I want to be able to set things like CTS, DCD, DSR, and RI (Ring line indicator) on the port. I know how to enable/disable DTR and RTS, but I can't find any way to change any other settings, ideally I'd like to be able to do low level IOCTL settings...

Any help would be most appreciated.

 

            -David-

解决方案

Try this:

serialport.Close();

serialport.Dispose();


这篇关于SerialPort配置C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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