F11和F5执行的结果不一样? F11和F5执行的结果不一样?我写一个方法,直接F5,出来的结果和F11出来的结果不一样,方法是返回一字符串。F5返回的字符串只有一小部份,而F11返回是全部》 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public string ExeATCommand ( string p_ATCommand ) { string result = string.Empty; // 返回结果内容 int SendCommandCount = 0; // 重试次数 if (p_ATCommand != string.Empty && s_port.IsOpen == true) { s_port.Write(p_ATCommand); // 输出命令到串口 System.Threading.Thread.Sleep(retryTimeOut); // 延迟指定时间 while (SendCommandCount <= retryCount) { // 没有达到重试次数时,始终执行 System.Threading.Thread.Sleep(retryTimeOut); // 延迟指定时间 result += s_port.ReadExisting(); // 读取结果 if (result.Length > 0 && result.Length > p_ATCommand.Length) { result = result.Replace(p_ATCommand + "\r\r\n", string.Empty); // 去掉发送过来的命令,关心结果 break; } SendCommandCount++; } } return result; } 串口数据读取?如果是的话,就是你的时间延迟问题。你是在什么环境下,vs2003 or vs2005? 如果你用的是2005带的com话,数据来的有事件触发。在相应的事件中做处理要合理些。 如果只能看到子类,而隐藏掉基类 请问如何得到一个映射文件的真实目录? 请问这个要用什么控件?速度!!!! 有谁会画有立体感的直线?? 关于DataTable.Select()方法的一个小问题 求救。。。Datagridview编辑后不会自动添加新一行 ToolTip问题,高手帮忙~ 弹出子窗体时隐藏父窗体 怎样给一个fileinfo对象重新赋值 POST提交特殊字符处理问题 Winamp中的out_disk.dll怎么引用不了? 求一解决方案,在线等着啦!!!
{
string result = string.Empty; // 返回结果内容
int SendCommandCount = 0; // 重试次数
if (p_ATCommand != string.Empty && s_port.IsOpen == true)
{ s_port.Write(p_ATCommand); // 输出命令到串口
System.Threading.Thread.Sleep(retryTimeOut); // 延迟指定时间
while (SendCommandCount <= retryCount)
{
// 没有达到重试次数时,始终执行
System.Threading.Thread.Sleep(retryTimeOut); // 延迟指定时间
result += s_port.ReadExisting(); // 读取结果
if (result.Length > 0 && result.Length > p_ATCommand.Length)
{
result = result.Replace(p_ATCommand + "\r\r\n", string.Empty); // 去掉发送过来的命令,关心结果
break;
}
SendCommandCount++; }
}
return result;
}