嘿傢伙我試圖從窗口窗體使用AT命令發送短信。但是陷入這個功能。它說:「Failed to set message format.
」C#短信發送錯誤(AT命令)
recievedData = ExecCommand(port,"AT+CMGF=1", 1000, "Failed to set message format."); // Error in this line => Failed to set message format
String command = "AT+CMGS=\"" + PhoneNo + "\"";
recievedData = ExecCommand(port,command, 300, "Failed to accept phoneNo");
command = Message + char.ConvertFromUtf32(26) + "\r";
recievedData = ExecCommand(port,command, 3000, "Failed to send message"); //3 seconds
if (recievedData.EndsWith("\r\nOK\r\n"))
{
isSend = true;
}
else if (recievedData.Contains("ERROR"))
{
isSend = false;
}
return isSend;
}
catch (Exception ex)
{
throw ex;
}
}
http://www.codeproject.com/Articles/38705/發送和閱讀短信通過GSM調制解調器使用AT-Com閱讀此頁可能對您有所幫助... –
@AnantDabhi感謝您考慮我的帖子..但事實上,已從您提到的網站獲取此代碼,並且錯誤來自相同的代碼。 我的手機連接到正確的端口,但無法獲得通過該錯誤 –