我用mscomm控件通讯的时候
string output
axMSComm1.Output=output
然后byte bytein[] bytein= new byte[7];
bytein[0]=0x1B;
bytein[1]=0x10; bytein[2]= 0x00; bytein[3]=0x00; bytein[4]= 0x05 ; bytein[5]= 0x44; bytein[6]= 0xD0;然后我怎么bytein七个字节 通过 output参数放入串口
有朋友说这样的using System.Text;ASCIIEncoding ascii = new ASCIIEncoding();
string str = ascii.GetString(bytein);
我这样测试了,还是不可以的 应为在ascii 里面 0x00 ,0x05 都是空的,对方就认不出来了,请问我怎么做
string output
axMSComm1.Output=output
然后byte bytein[] bytein= new byte[7];
bytein[0]=0x1B;
bytein[1]=0x10; bytein[2]= 0x00; bytein[3]=0x00; bytein[4]= 0x05 ; bytein[5]= 0x44; bytein[6]= 0xD0;然后我怎么bytein七个字节 通过 output参数放入串口
有朋友说这样的using System.Text;ASCIIEncoding ascii = new ASCIIEncoding();
string str = ascii.GetString(bytein);
我这样测试了,还是不可以的 应为在ascii 里面 0x00 ,0x05 都是空的,对方就认不出来了,请问我怎么做
解决方案 »
- C#为什么我的打印提示加载报表失败?
- 【紧急求助】:如何检测串口DB9引脚的变化?DCD、DSR、CTS/DTR?◆
- 如何使不同数据库中的表融合为一张表,使之可在页面上展示和查询?
- 这个winform窗体效果怎么整? 在线等
- 如何引用虚拟目录以外的文件(例如图象文件)
- C# 数据连接问题
- aspx发布以后,原本页面上的图片都不显示了
- 外部调用c#的Webservice的问题
- 怎么没有人来救命呀!!急死我了
- 有什么资料有介绍Sqlexception的错误代码和代表的错误信息
- 用户登陆界面的问题。。求教各位大大了。。在线等。。。
- 如何给DataGrid的列标头加中文,这个B/S很容易实现,但是,不知道C/S模式(即windows form) 下如何实现!!!!
bytein[0]=0x1B;
bytein[1]=0x10;
bytein[2]= 0x00;
bytein[3]=0x00;
bytein[4]= 0x05;
bytein[5]= 0x44;
bytein[6]= 0xD0;output.Append(bytein);axMSComm1.Output=output;