短信在Windows移动中发送

时间:2009-08-27 10:02:29

标签: sms windows-mobile

我为Windows Mobile 5.0开发用于发送和接收短信。首先我发短信很好。我收到短信后使用MessageInterceptor,收到短信后我无法发送短信,短信发送错误。

IN表格加载

MsgInterpret.MessageReceived += new MessageInterceptorEventHandler(MsgInterpret_MessageReceived);
void MsgInterpret_MessageReceived(object sender, MessageInterceptorEventArgs e)
{
 try
 {
    ReceiveMsg = (SmsMessage)e.Message;
    sndrNo = ReceiveMsg.From.Name;
    Msgbody = ReceiveMsg.Body;
    label2.Text = sndrNo;
    textBox1.Text = Msgbody;
 }
 catch (Exception ex)
 {
    MessageBox.Show(ex.Message);
 }
}

private void Send_btn_Click(object sender, EventArgs e)
{
            try
            {
                string mAtmId = "Hello Raja"
                SmsMessage sms = new SmsMessage();
                sms.Body = mAtmId;
                sms.To.Add(new Recipient(Txt_PhoneNo.Text.Trim()));
                sms.Send();
                MessageBox.Show("Message send successfully");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
}

问题是,在使用MsgInterpret.MessageReceived事件接收短信之前正确发送短信,然后发送短信我收到了错误。

0 个答案:

没有答案