SmsMessage.Send()失败。 [英] SmsMessage.Send() Fails.
问题描述
(这篇文章已被编辑。)
你好!
最近我一直在做一个小应用程序,它监听以特定字符串开头的传入文本消息。 (我正在使用HTC TyTN II设备。)
当我收到消息时,我也是发送回复,例如"感谢您的参与。"要发送短信,我使用了SmsMessage类。
< p align = left>大多数情况下,发送短信的工作正常。但是,有时我会从ThrowCorrectSmsException抛出一个SmsException。这是我上次获得异常时的堆栈跟踪:
at Microsoft .WindowsMobile.PocketOutlook.MAPIUtilities.ThrowCorrectSmsException(Int32 errorCode)
在Microsoft.WindowsMobile.PocketOutlook.SmsMessage.Send()
在Alea.Phone.SMS.SendMessage(String message,String [] addresses)
在Alea.Form1.mi_MessageReceived(Object sender,MessageInterceptorEventArgs e)
at Microsoft.WindowsMobile.PocketOutlook.MessageInterception.MessageInterceptor.MessageWindow_MessageReceived(Object sender,MessageInterceptorEventArgs e)
at Microsoft.WindowsMobile.PocketOutlook.MessageInterception.MessagingMessageWindow.WndProc (Message& msg)
在Microsoft.WindowsCE.Forms.MessageWindow._WndProc(Message& msg)
中的Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
在System.Windows.Forms。 Application.Run(Form fm)
在Alea.Program.Main()
Alea.Phone.SMS.SendMessage是一个静态类。以下是方法的片段:
您使用的是理想的手机吗?它永远不会与理想的手机断开连接,理想的软件永远不会失败?如果不是,则预期会出现定期故障。考虑添加重试和/或打印错误代码。
(This post has been edited.)
Hello!
Recently I've been doing a small application that listenes for incoming text messages that starts with a specific string. (I'm using the HTC TyTN II device).
When I receive a message, I'm also sending a response back, like "Thanks for your participation." To send sms's I've used the SmsMessage class.
Mostly, sending text messages works fine. Sometimes, however, I get an SmsException thrown from ThrowCorrectSmsException. This is the stack trace from the last time I got the exception:
at Microsoft.WindowsMobile.PocketOutlook.MAPIUtilities.ThrowCorrectSmsException(Int32 errorCode)
at Microsoft.WindowsMobile.PocketOutlook.SmsMessage.Send()
at Alea.Phone.SMS.SendMessage(String message, String[] addresses)
at Alea.Form1.mi_MessageReceived(Object sender, MessageInterceptorEventArgs e)
at Microsoft.WindowsMobile.PocketOutlook.MessageInterception.MessageInterceptor.MessageWindow_MessageReceived(Object sender, MessageInterceptorEventArgs e)
at Microsoft.WindowsMobile.PocketOutlook.MessageInterception.MessagingMessageWindow.WndProc(Message& msg)
at Microsoft.WindowsCE.Forms.MessageWindow._WndProc(Message& msg)
at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
at System.Windows.Forms.Application.Run(Form fm)
at Alea.Program.Main()
Alea.Phone.SMS.SendMessage is a static class. The following is a snippet from the method:
Are you using ideal cell carrier which never disconnects with ideal phone which never fails on ideal software which always works? If not then periodic failures are expected. Consider adding a retry and/or print out error code.
这篇关于SmsMessage.Send()失败。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!