Torna al Thread

Imports System.Reflection Imports Microsoft.WindowsMobile.PocketOutlook Imports Microsoft.WindowsMobile.PocketOutlook.MessageInterception Public Class Form1 Dim mi As MessageInterceptor Const KEY_RULE As String = "testSMS" Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing RemoveHandler mi.MessageReceived, AddressOf mi_MessageReceived End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If MessageInterceptor.IsApplicationLauncherEnabled(KEY_RULE) Then mi = New MessageInterceptor(KEY_RULE) Else mi = New MessageInterceptor(InterceptionAction.NotifyAndDelete) mi.MessageCondition = New MessageCondition(MessageProperty.Body, MessagePropertyComparisonType.StartsWith, _ KEY_RULE) Dim appPath As String = Assembly.GetExecutingAssembly.GetName.CodeBase mi.EnableApplicationLauncher(KEY_RULE, appPath) End If AddHandler mi.MessageReceived, AddressOf mi_MessageReceived End Sub Sub mi_MessageReceived(ByVal sender As Object, ByVal e As MessageInterceptorEventArgs) MessageBox.Show(CType(e.Message, SmsMessage).Body, "SMS ricevuto!!!") End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Close() End Sub End Class
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5