C#高速串口通讯方案winform实例

[复制链接]
发表于 2025-12-15 16:38:08 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
C#高速串口通讯方案winform实例

  1. using System;
  2. using System.IO.Ports;
  3. using System.Threading;
  4. using System.Windows.Forms;
  5. public class SerialPortForm : Form
  6. {
  7.    
  8.    
  9.     private ComboBox cboPorts;
  10.     private Button btnConnect;
  11.     private Button btnSend;
  12.     private TextBox txtMessage;
  13.     private RichTextBox rtbReceiver;
  14.     private SerialPort serialPort;
  15.     private System.Threading.Timer uiUpdateTimer;
  16.     public SerialPortForm()
  17.     {
  18.    
  19.    
  20.         this.Text = "串口通讯窗体";
  21.         this.Size = new System.Drawing.Size(400, 300);
  22.         cboPorts = new ComboBox();
  23.         cboPorts.Location = new System.Drawing.Point(20, 20);
  24.         cboPorts.DropDownStyle = ComboBoxStyle.DropDownList;
  25.         btnConnect = new Button();
  26.         btnConnect.Text = "连接";
  27.         btnConnect.Location = new System.Drawing.Point(150, 20);
  28.         btnConn
复制代码
回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表