110,534
社区成员
发帖
与我相关
我的任务
分享
body = ReceiveSmsStr.Substring(0, ReceiveSmsStr.IndexOf("#"));
ReceiveSmsStr = ReceiveSmsStr.Substring(ReceiveSmsStr.IndexOf("#") + 1);
time = ReceiveSmsStr.Substring(0, ReceiveSmsStr.IndexOf("|"));
ReceiveSmsStr = ReceiveSmsStr.Substring(ReceiveSmsStr.IndexOf("|"));
ss = body.Substring(3, 3);
if (ss == "dt")
{
MessageBox.Show(ss);
}
else
{
MessageBox.Show("有错?");
MessageBox.Show(ss);
}
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at System.String.Substring(Int32 startIndex, Int32 length)
at war_tools.Form1.timer1_Elapsed(Object sender, ElapsedEventArgs e) in D:\短信平台-最新\sms\Form1.cs:line 217