短信发送例外 [英] SMS Sending Exception

查看:90
本文介绍了短信发送例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行具有2层安全策略的代码时的Hello



SmsMessage sms = new SmsMessage(" + 4444","发送sms!");
sms.Send();

我得到以下异常

Microsoft.WindowsMo​​bile.PocketOutlook.SmsException未处理
Message ="发送Sms消息时出错。

ErrorCode = -2147467259
NativeErrorCode = -2147467259
StackTrace:
at Microsoft.WindowsMo​​bile.PocketOutlook.MAPIUtilities.ThrowCorrectSmsException(Int32 errorCode)
at Microsoft.WindowsMo​​bile.PocketOutlook.SmsMessage.Send()
at SendReceiveSMS.Form1.menuSend_Click (Object sender,EventArgs e)
System.Windows.Forms.MenuItem.OnClick(EventArgs e)
System.Windows.Forms.Menu.ProcessMnuProc(Control ctlThis,WM wm,Int32 wParam,Int32 lParam)
在System.Windows.Forms.Form.WnProc(WM wm,Int32 wParam,Int32 lParam)
在System.Windows.Forms.Control._Internal WnProc(WM wm,Int32 wParam,Int32 lParam)
在Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
在System.Windows.Forms.Application.Run(Form fm)
在SendReceiveSMS .Program.Main()

我知道我可以处理异常,但我也好奇为什么在我切换2层配置时出现异常

Hello when running this code with 2-tier security policy

SmsMessage sms = new SmsMessage("+4444", "Sending sms!");
sms.Send();

i get the following exception

Microsoft.WindowsMobile.PocketOutlook.SmsException was unhandled
  Message="Error sending Sms Message."
  ErrorCode=-2147467259
  NativeErrorCode=-2147467259
  StackTrace:
       at Microsoft.WindowsMobile.PocketOutlook.MAPIUtilities.ThrowCorrectSmsException(Int32 errorCode)
       at Microsoft.WindowsMobile.PocketOutlook.SmsMessage.Send()
       at SendReceiveSMS.Form1.menuSend_Click(Object sender, EventArgs e)
       at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
       at System.Windows.Forms.Menu.ProcessMnuProc(Control ctlThis, WM wm, Int32 wParam, Int32 lParam)
       at System.Windows.Forms.Form.WnProc(WM wm, Int32 wParam, Int32 lParam)
       at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
       at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
       at System.Windows.Forms.Application.Run(Form fm)
       at SendReceiveSMS.Program.Main()

I know that i can handle the exception but i am also curious why the exception appears when i switch in the 2-tier configuration

推荐答案

嘿伙计,我有同样的问题。
你找到了解决办法吗?

我收到了错误如果我首先从蜂窝仿真器发送一条消息到Winodws Mobile Professional仿真器,如果我从WM6仿真器发送一条消息到Cellular EMulator,我得到了这个错误:(


<谢谢
Hey guy,

i have the same problm.
Do you found a solution ?

I got the error if i send first a message from the Cellular Emulator to the Winodws Mobile Professional Emulator and if i send then a message from the WM6 Emulator to the Cellular EMulator i got this error  :(



Thanks


这篇关于短信发送例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆