主题:请教高手MSCOMM串口通讯问题!急!谢谢回复!
我原用VB写的串口通讯协议代码(一部分):
Dim binbuff(7) As Byte
binbuff(0) = &H55
binbuff(1) = &HAA
binbuff(2) = count '第几行
binbuff(3) = &H1 '幕数
binbuff(4) = &HB '移入方式
binbuff(5) = &HC '移出方式
binbuff(6) = &H0 '停留时间 0为不停留
binbuff(7) = &H0 '保留字节
MSComm1.Output = binbuff
现我要用C#.NET来写通讯协议!请问以上VB代码在C#.NET该如何写?
我在C#里声明:
byte[] binbuff=new byte [8];
binbuff[0]=&H55;
binbuff[1]=&HAA;
binbuff[2]=&1;
binbuff[3]=&H1;
binbuff[4]=&HB;
binbuff[5]=&HC;
binbuff[6]=&H0;
binbuff[7]=&H0;
this.axMSComm1 .Output =binbuff;
报错!
请教高手!万分感谢!
Dim binbuff(7) As Byte
binbuff(0) = &H55
binbuff(1) = &HAA
binbuff(2) = count '第几行
binbuff(3) = &H1 '幕数
binbuff(4) = &HB '移入方式
binbuff(5) = &HC '移出方式
binbuff(6) = &H0 '停留时间 0为不停留
binbuff(7) = &H0 '保留字节
MSComm1.Output = binbuff
现我要用C#.NET来写通讯协议!请问以上VB代码在C#.NET该如何写?
我在C#里声明:
byte[] binbuff=new byte [8];
binbuff[0]=&H55;
binbuff[1]=&HAA;
binbuff[2]=&1;
binbuff[3]=&H1;
binbuff[4]=&HB;
binbuff[5]=&HC;
binbuff[6]=&H0;
binbuff[7]=&H0;
this.axMSComm1 .Output =binbuff;
报错!
请教高手!万分感谢!