Search the web
Sign In
New User? Sign Up
codesnips · Code Snippets
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Using MSN Alerts   Message List  
Reply | Forward Message #24 of 48 |

What are MSN Alerts?

 

MSN Alerts Service is a part of Microsoft .NET My Services Initiative. It enables the service provider to reach its users through Instant Messages. Note that it will work on any type of devices, either mobile or desktops.

 

List some example applications?

 

1)      Event Management Application: Notifies the user instantly of the event it registers.

2)      Order Tracking Application: User is instantly notified if any change occurred in the order status.

Etc. etc.

 

So, where can you find the SDK? Licensing?

 

The MSN Alert SDK is downloaded for free from the following URL.

 

http://download.microsoft.com/download/.netalerts/install/5.01/nt5xp/en-us/installalertssdkserver.exe

 

It also contains necessary licensing agreement information as MSN Alerts service in the production setup is not free of cost.

 

Building our Hello World MSN Alert Application:

 

The following listing demonstrates a sample Console Application for MSN Alerts. For all the classes, properties and methods involved in the sample, consult the SDK documentation. Note that you need to Add Reference to the Microsoft Notification SDK Type Library (msnotify.dll). This COM Component is automatically registered when you install the Developer’s SDK.

 

<code>

 

using System;

using System.Reflection;

using System.Runtime.InteropServices;

 

// the following namespace is automatically added when you add a

// reference to the Microsoft Notifications SDK Type Library. Because the

// MSN Alerts subsystem is built using COM therefore we need the

// System.Runtime.InteropServices to access the COM objects through

// Managed Code

 

using MSNOTIFYLib;

 

namespace AlertSample

{

      class MainClass

      {

            static void SetNotificationValues(MsnNotificationClass Alert)

            {

 

                  // set notification values

                  Alert.ID = "1234";

                  Alert.MessageID = "0";

 

                  // this is also fixed with the demo

                  Alert.SiteID = "140001000";

 

                  // directory where the dev edition of the toolkit is installed

                  Alert.SiteURL = "http://localhost/MsAlertsSdkServer";

                 

                  // activates when the user clicks on the Alert window

                  Alert.ActionURL = "/action.asp";

 

                  // activates when the user clicks on the 'change' text on the Alert window

                  Alert.SubscribeURL = "/subscr.asp";

 

                  Alert.BodyLanguage = "1033";

 

                  // icon shown on the top left corner

                  Alert.BodyIcon = "/car.png";

 

                  // body of the alert message

                  Alert.Body = "<TEXT>Hello World</TEXT>";

 

 

            }

 

            static void Main(string[] args)

            {

                  //

                  // TODO: Add code to start application here

                  //

 

                  // creating the required objects

                  MsnNotificationClass Alert = new MsnNotificationClass();

                  NotificationTransportClass Transport = new NotificationTransportClass();

                  NotificationsUtilityClass Util = new NotificationsUtilityClass();

 

                  // setting the destination url

                  Transport.DestinationUrl = "http://localhost/MSAlertsSDKServer/MSAlertsSDKServer.dll";

 

                  // setting username and password

                  // these values are embedded with the sample toolkit

                  // therefore these are only for demo purposes

                  string userName = "Adventure Works";

                  string password = "password";

 

           

                  SetNotificationValues(Alert);

 

                  Console.WriteLine("Alerts Submission System Started");

           

// passport id, acquire using Passport Sign-in, dummy // in this case to pop-up messages locally.

 

                  Alert.ToPID = "0x01234567:0x89abcdef";

 

                  Console.WriteLine("XML:");

                  Console.WriteLine(Alert.GetSerialization());

 

                  Transport.SendNotification(1,userName,password,Alert,1);

 

                  Transport.DrainNotifications(0);

 

            }

      }

}

 

</code>

 

After running the sample application, we see the following pop-up appearing from the bottom-right corner of your desktop.

 

 

Conclusion:

 

MSN Alerts Service is an exciting way to develop client centric applications. Your imagination is the only limit here.



Tue Dec 3, 2002 5:54 pm

laghari78
Offline Offline
Send Email Send Email

Forward
Message #24 of 48 |
Expand Messages Author Sort by Date

What are MSN Alerts? MSN Alerts Service is a part of Microsoft .NET My Services Initiative. It enables the service provider to reach its users through Instant ...
Nauman Laghari
laghari78
Offline Send Email
Dec 3, 2002
5:58 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help