解决串口接收中文乱码问题
摘要:
定义:SerialPort ComDevice = new SerialPort();在开启串口前 设置前后文本转换的字符编码代码:ComDevice.Encoding = System.Text.Encoding.GetEncoding("GB2312");//此行非常重要 可解决接收中文乱码问题接收代码: #region 串口相关操作 SerialPort ComDevice = new SerialPort(); private void GetComList() { //获取可用串口列表 s... 阅读全文
posted @ 2014-01-16 13:22 冬夜冷雨 阅读(16395) 评论(1) 推荐(0)
浙公网安备 33010602011771号