pouya_devil
دوشنبه 30 دی 1387, 15:34 عصر
با سلام به همه دوستان خوبم
من برنامه ی دریافت sms رو مینویسم .... ولی هر کاری میکنم sms رو در برنامه دریافت کنم نمیشه:عصبانی++::عصبانی++::عصب نی++: .... کدی که من نوشتم اینه :
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.PocketOutlook.MessageInter ception;
using Microsoft.WindowsMobile.PocketOutlook;
using System.Net;
namespace recieve_sms2
{
public partial class Form1 : Form
{
MessageInterceptor[] mi = new MessageInterceptor[2];
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
InterceptSMS();
}
public void InterceptSMS()
{
string[] testFilter ={ "111", "222" };
if (MessageInterceptor.IsApplicationLauncherEnabled("Intercept_Sms"))
{
mi[0] = new MessageInterceptor("Intercept_Sms");
mi[1] = new MessageInterceptor("Intercept_Sms");
}
else
{
for (int i = 0; i < testFilter.Length; i++)
{
//The first array
mi[i] = new MessageInterceptor(InterceptionAction.NotifyAndDel ete, true);
mi[i].MessageCondition = new MessageCondition(MessageProperty.Body,
MessagePropertyComparisonType.StartsWith, testFilter[i], true);
mi[i].MessageReceived += new MessageInterceptorEventHandler(_SMSCatcher_Message Received);
}
}
}
void _SMSCatcher_MessageReceived(object sender, MessageInterceptorEventArgs e)
{
MessageBox.Show(((SmsMessage)e.Message).From.Addre ss, "Message ");//comment
}
}
}
.... حالا اگه کسی هست بتونه کمک کنه یا یه sample کد دیگه بهم بده ممنون میشم....:ناراحت:
من برنامه ی دریافت sms رو مینویسم .... ولی هر کاری میکنم sms رو در برنامه دریافت کنم نمیشه:عصبانی++::عصبانی++::عصب نی++: .... کدی که من نوشتم اینه :
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.PocketOutlook.MessageInter ception;
using Microsoft.WindowsMobile.PocketOutlook;
using System.Net;
namespace recieve_sms2
{
public partial class Form1 : Form
{
MessageInterceptor[] mi = new MessageInterceptor[2];
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
InterceptSMS();
}
public void InterceptSMS()
{
string[] testFilter ={ "111", "222" };
if (MessageInterceptor.IsApplicationLauncherEnabled("Intercept_Sms"))
{
mi[0] = new MessageInterceptor("Intercept_Sms");
mi[1] = new MessageInterceptor("Intercept_Sms");
}
else
{
for (int i = 0; i < testFilter.Length; i++)
{
//The first array
mi[i] = new MessageInterceptor(InterceptionAction.NotifyAndDel ete, true);
mi[i].MessageCondition = new MessageCondition(MessageProperty.Body,
MessagePropertyComparisonType.StartsWith, testFilter[i], true);
mi[i].MessageReceived += new MessageInterceptorEventHandler(_SMSCatcher_Message Received);
}
}
}
void _SMSCatcher_MessageReceived(object sender, MessageInterceptorEventArgs e)
{
MessageBox.Show(((SmsMessage)e.Message).From.Addre ss, "Message ");//comment
}
}
}
.... حالا اگه کسی هست بتونه کمک کنه یا یه sample کد دیگه بهم بده ممنون میشم....:ناراحت: