如何在C#代码中将已知的COM端口自动更改为COM1? [英] how to change known COM port to COM1 automatically in C# codeing?

查看:136
本文介绍了如何在C#代码中将已知的COM端口自动更改为COM1?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序有问题.我的程序知道COM端口,但我想编写代码以自动选择COM1 ...
请帮助我.

Hi, I have problem in my program. my program know COM ports but i want to write a code to choose COM1 automatically...
please help me.

推荐答案

通常情况下,人们不知道自己想要什么,必须去发现它,在您的情况下:
Usually people don''t know what they want and have to discover it, in your case :
System.IO.Ports.SerialPort ComPort1 = new System.IO.Ports.SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);


http://stackoverflow.com/questions/2002890/change- com-port-via-registry-command-line-software [
Change COM port name to COM1 automatically[^]
http://stackoverflow.com/questions/2002890/change-com-port-via-registry-command-line-or-software[^]


这篇关于如何在C#代码中将已知的COM端口自动更改为COM1?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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