How to use. Net to develop MSN AIDS

Source: Internet
Author: User
Recently, I have read a lot of MSN development materials and summarized the following two development ideas:
1. directly call the MSN remote service. In the Net development environment, the most famous is the DotMSN Development Library (Open Source ). DotMSN is an independent open-source class library. It does not need to interact with the official MSN Messenger, so it can communicate with the MSN Messenger Service without installing MSN Messenger. dotMSN is written in C #, so. all languages supported by the. NET environment can be used. the DotMSN class library is easy to use and easy to implement. It is flexible, robust, and lightweight, which facilitates integration into any application system. The DotMSN application system can implement various functions, such as creating message robots and custom clients.
If your application needs to communicate with the Messenger service, DotMSN is a good tool.
The following figure shows the relationship between DotMSN and your application.

2. Call MSN component development. The main function is to reference MessengerClient. dll. The following is an article from a netizen. Learn Together:

Develop an MSN plug-in

MSN8.0 opens some interfaces, so that we can easily perform plug-in development operations within its limited scope.

Development Environment: VS 2005. NET 2.0 MSN 8.0

There is a MessengerClient. dll file under the MSN installation directory. This file must be referenced to create a plug-in.

Create a DWORD under Registry SoftWare \ MicroSoft \ MSNMessager: the value of AddInFeatureEnabled is 1 to enable the plug-in function.

Create a project and reference MessengerClient. dll, you can see that some internal structures have a common interface of IMessagerAddIN, we write the plug-in to expand this interface, override the function void Initialize (Microsoft. messenger. messengerClient messenger ).

There are not many events and methods in the event, that is, the event receives a message, sends a message, and changes the status. The method is to send a text or a pop-up screen, what Can MS do with this framework interface besides allowing us to write Robot robot chats -_-#!!!

DLL operation restrictions are also very strict, can not access local files, can not use MemoryStream to allocate memory..., to draw a picture, you can only use GDI + painting .....

I wanted to write an automatic Avatar change plug-in. I found that the interface didn't provide this item ..., however, we still need to put out the simplest Sample example and follow this architecture to expand our plug-ins.

Using System;
Using System. Drawing;
Using System. Collections. Generic;
Using System. Text;
Using Microsoft. Messenger;

Namespace Red_angelX.MSNPlusIn
...{
/** // <Summary>
/// The MSN Avatar automatically replaces the plug-in
///
/// @ Author: red_angelx
/// </Summary>
Public class autochangeface: imessential geraddin
...{
Messengerclient MSN;
Public void initialize (messengerclient Messager)
...{
MSN = Messager;

MSN. addinproperties. creator = "red_angelx ";
MSN. addinproperties. Description = "Copyright (c) 2006-2009 red_angelx ";
MSN. addinproperties. friendlyname = "automatic Avatar replacement plug-in ";
MSN. addinproperties. url = new uri ("http://blog.csdn.net/Red_angelX ");
MSN. addinproperties. Status = userstatus. online;

MSN. addinproperties. usertile = randimage ();
}

Private image randimage ()
...{
// Font ft = new System. drawing. font ("", 14.25F, System. drawing. fontStyle. bold, System. drawing. graphicsUnit. point, (System. byte) (134 )));
Bitmap bm = new Bitmap (48, 48 );
Graphics g = Graphics. FromImage (bm );
G. Clear (Color. Black );
G. DrawString ("Red", new Font ("", 16, FontStyle. Italic), Brushes. Red, 0, 10 );
Return bm;
}
}
}

In the MSN menu tool, choose> Option> Add-on, load the DLL. MSN also has requirements on the file name of the plug-in, that is, NAMESPACE + CLASS + DLL, that is to say, my DLL must be named Red_angelX.MSNPlusIn.AutoChangeFace.dll before it can be used properly. If these interfaces can implement interesting functions rather than chatbots, it's so exciting -_-#

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.