1、获取当前可用串口端口号
1 using System.IO.Ports; 2 string[] portNames = SerialPort.GetPortNames();
2、TextBox换行、设置光标位置、随文本滚动
1 txtRxData.Text += Environmen.NewLine; 2 txtRxData.SelectionStart = txtRxData.TextLength; 3 txtRxData.ScrollToCaret();