如何在c#中手动修改serialport portname和baudrate [英] how to modify serialport portname and baudrate manually in c#

查看:378
本文介绍了如何在c#中手动修改serialport portname和baudrate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai,

我正在做一个串口读写项目。它工作正常,但现在我想通过组合框从我的Windows窗体修改我的串口名称和波特率。用户想要从组合框中选择端口名和波特率,那时我的seialport属性必须根据组合框值进行更改。

例如现在我的项目使用serialport portname COM3读取和写入数据,并通过设置读取波特率9600我的表单中的serialport控件的属性。现在我想通过选择portname作为串口名称想要更改的COM1并同时读取和写入数据来通过组合框更改属性...

请帮助...

谢谢提前....

Hai,
I am doing one project for serial port read and write. It works fine but now i want to modify my serialport name and baudrate from my windows form through combobox. User want to select the portname and baudrate from combobox at that time my seialport property have to change based on combobox value.
For example now my project read and write data with serialport portname COM3 and baudrate 9600 by setting the properties of serialport control in my form. Now i want to change the property through combobox by selecting portname as COM1 that serialportname want to change and read and write data simultaneously...
Please help...
thanks in advance....

推荐答案

您可以按照设置方式更改值,请阅读: C#中的串口通信初学者 [ ^ ]
You can change the values the same way you set them, read this : Serial Comms in C# for Beginners[^]


这篇关于如何在c#中手动修改serialport portname和baudrate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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