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);
            }

posted @ 2013-10-24 11:11  shuenjian901  阅读(216)  评论(0编辑  收藏  举报