serialport串口通讯

在.NET Framework 2.0中提供了SerialPort类,该类主要实现串口数据通信

= System.IO.Ports.SerialPort.GetPortNames();获取电脑有哪几个串口?

 string[] portList = System.IO.Ports.SerialPort.GetPortNames();
            for (int i = 0; i < portList.Length; ++i)
            {
                string name = portList[i];
                comboBox1.Items.Add(name);
            }

原文地址:https://www.cnblogs.com/shuenjian901/p/3385643.html