0
我試圖在Windows Mobile中獲得自動消息回覆。我正在使用似乎第一次工作的MessageInterceptor類。但它似乎沒有工作的秒鐘消息!不知道是否必須有無限循環。我沒有太多的Windows Mobile開發經驗,所以請建議最好的方法。MessageInterceptor不會第二次使用窗口移動應用程序啓動
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsMobile;
using Microsoft.WindowsMobile.PocketOutlook;
using Microsoft.WindowsMobile.PocketOutlook.MessageInterception;
namespace TextMessage3
{
public partial class Form1 : Form
{
protected MessageInterceptor smsInterceptor = null;
public Form1()
{
InitializeComponent();
debugTxt.Text = "Calling Form cs";
//Receiving text message
MessageInterceptor interceptor = new MessageInterceptor(InterceptionAction.NotifyandDelete);
interceptor.MessageReceived += SmsInterceptor_MessageReceived;
}
public void SmsInterceptor_MessageReceived(object sender,
MessageInterceptorEventArgs e)
{
SmsMessage msg = new SmsMessage();
msg.To.Add(new Recipient("James", "+16044352345"));
msg.Body = "Congrats, it works!";
msg.Send();
//Receiving text message
MessageInterceptor interceptor = new MessageInterceptor(InterceptionAction.NotifyAndDelete);
interceptor.MessageReceived += SmsInterceptor_MessageReceived;
}
}
}
感謝,
擔