qq_35821578
2017-10-11 06:14无法将类型“byte”隐式转换为“byte[]”
byte firstByte = Convert.ToByte(serialPort.ReadByte());
int bytesRead = serialPort.BytesToRead;
byte[] bytesData = new byte[bytesRead + 1];
bytesData[0] = firstByte;
for (int i = 1; i <= bytesRead; i++)
bytesData = Convert.ToByte(serialPort.ReadByte());
txtReceive.Text = System.Text.Encoding.Default.GetString(bytesData);
c#新手想问倒数第二句语句显示错误 请问怎样结解决。
- 点赞
- 回答
- 收藏
- 复制链接分享
2条回答
为你推荐
- 去接收器隐式指针转换不起作用
- it技术
- 互联网问答
- IT行业问题
- 计算机技术
- 编程语言问答
- 2个回答
- 同类型为什么要强制转换(自己强转成自己)/ASP.NET Web程序重复引用(引用来自同一文件)问题(已解决)?
- c#
- 3个回答
- Could not execute method for android :onClicked
- android
- 2个回答
- 类型不匹配:不能从 Integer 转换为 int
- 转换
- 4个回答
- 无法将类型“int”隐式转换为“byte”。
- java
- c#
- 2个回答
换一换