using Microsoft.WindowsMobile;
using Microsoft.WindowsMobile.PocketOutlook;
using Microsoft.WindowsMobile.PocketOutlook.MessageInterception;
// Объявляем переменную
private MessageInterceptor smsInterceptor;
private void smsInterceptor_MessageReceived(object sender,
MessageInterceptorEventArgs e) {
// Обработка входящего сообщения
MessageBox.Show("К вам пришло срочное сообщение");
}
private void butSendSMS_Click(object sender, EventArgs e) {
SmsMessage message = new SmsMessage();
// Номер получателя
message.To.Add(new Recipient("4250010001"));
// Текст сообщения
if (chkAlert.Checked) {
// Если взведен флажок, то добавляем слово Срочно!
message.Body = "Срочно! " + txtSMSText.Text;
} else {
message.Body = txtSMSText.Text;
}
// Посылаем сообщение
message. Send();
}
private void Form1_Load(object sender, EventArgs e) {
smsInterceptor =
new MessageInterceptor(InterceptionAction.NotifyAndDelete, true);
smsInterceptor.MessageCondition =
new MessageCondition(MessageProperty.Body,
MessagePropertyComparisonType.StartsWith, "Срочно", true);