110,528
社区成员
发帖
与我相关
我的任务
分享
//不超过70个字
private static string SendSMSNormal(SerialPort sp, string tel, string content)
{
string strCmd = "AT+CMMS=3\r";
sp.Write(strCmd);
Thread.Sleep(100);
strCmd = "AT+CMGF=1\r";
sp.Write(strCmd);
Thread.Sleep(100);
strCmd = "AT+CMGS=" + tel + "\r";
sp.Write(strCmd);
Thread.Sleep(100);
strCmd = EncodingUCS2(content) + "\x1A";
sp.Write(strCmd);
Thread.Sleep(10000);
string result = String.Empty;
byte[] buffer = new byte[128];
int count = sp.Read(buffer, 0, buffer.Length);
result = Encoding.UTF8.GetString(buffer, 0, count).Replace("\0", "");
return result;
}