嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元微信扫码支付:2 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
一个很好而小巧的串口调试助手,支持常用的300-115200bps波特率,能设置校验、数据位和停止位,能以ASCII码或十六进制接收或发送任何数据或字符(包括中文),可以任意设定自动发送周期,并能将接收数据保存成文本文件,能发送任意大小的文本文件。
private void SendHex_TextBox_Leave(object sender, EventArgs e)
{
int temp = 0;
string str = "";
SendHex_TextBox.Text = " ";
for (int i = 0; i < SendHex_TextBox.Text.Length; i )
{
if (SendHex_TextBox.Text[i] == ' ')
{
if (temp == 1)//单个字符
{
temp = 0;
str = "0" SendHex_TextBox.Text.Substring(i - 1, 1) " ";
}
}
else
{
temp ;
if (temp == 2)
{
temp = 0;
str = SendHex_TextBox.Text.Substring(i - 1, 2) " ";
}
}
}
SendHex_TextBox.Text = str;
string error = "";
for (int i = 0; i < SendHex_TextBox.Text.Length; i = 3)
{
try
{
byte b = Convert.ToByte(SendHex_TextBox.Text.Substring(i, 2), 16);
}
catch
{
error = (i / 3 1) ",";
}
}
this.MainMessage.Text = "发送数据框第" error.Substring(0, error.Length - 1) "个数据错误!";
}