introduction
1.1. Source and meaning of the topic The current instant messaging software is based on performance and user group considerations, most of which are based on C development, and there are also many Java development. As the instant messaging market is increased and .NET users are increasing, it is increasingly needed to run instant messaging software that runs on Microsoft's latest platform - .NET, which can effectively use the .NET Framework feature. This project fully utilizes many features of the new member Visual C # of the .NET platform, all of which use the .NET managed code development, and use the .NET Framework to implement the common functions of the local area network instant messaging software, and provide Event log, user feedback collection and other innovative features.
1.2. The current situation of instant messaging software Today's instant messaging software can be roughly divided into the following categories:
l Internet instant messaging software
This type of software is mainly for ordinary personal users, providing such as instant messaging, interactive entertainment, server providers, mainly for portals and online entertainment websites. The famous software has: Tencent QQ, MSN Messenger, AOL Instant Messenger, Yahoo Instant Messenger, Netease bubble.
It is worth pointing out that there is also a part of the software in this type of software that is not dedicated to its own server, but a server for other instant messaging providers to serve users, such as multi-protocol software Myim, IMU, Jabber.
l LAN Instant Communication Software
This type of software is mainly for members within a organization, used to provide online communication, information release, email, and auxiliary daily office, including internal employees.
l Enterprise instant messaging software
This type of software combines the functions of the above two types of software, realizing personal and organizational communication and communication within the enterprise.
1.3. Introduction to the C # language used in the program 1.3.1. Properties is named member of the class, structure, and interface. They provide a flexible mechanism for reading, writing, or computing private field values through a visitor.
A C # property called Name is defined as follows, which is packaged in private domain Name.
PRIVATE STRING NAME;
// a read-write instance property:
Public String Name
{
get
{
Return Name;
}
set
{
Name = value;
}
}
1.3.2. Index Defines "Indexer" to create a class as a "virtual array". An instance of such a class can be accessed using the [] array access operator. Define the indefinometers in the C # similar to the definition operator in C [], but the former is much flexible. For classes that encapsulate functions of similar arrays or similar characters, use the indexer to enable the user to access the class using the array syntax.
For example, suppose you want to define a class that makes the file as an array of bytes. If the file is very large, reading the entire file is unrealistic, especially when you just want to read or change a few bytes. By defining the FileByTearRay class, you can make the file appearance similar to byte arrays, but when reading or writing bytes, the actual input and output is the input and output of the file.
1.3.3. Entrusted C # A function pointer in C or C . Use the entrustment to make the programmer to encapsulate the method within the delegate object. You can then pass the delegate object to the code that can be called, without having to know which method will be called when compiling. Unlike the function pointers in C or C , the delegate is object-oriented, safe, and is safe.
The delegate declaration defines a type that uses a specific parameter and the return type package method. For static methods, the method of delegate the object package to be called. For example methods, the delegate object simultaneously encapsulates an example and a method on this instance. If you have a delegate object and a set of appropriate parameters, you can call the delegate with these parameters.
A interesting and useful attribute entrusted is that it does not know or not care about the object of the object you reference. Any object can be; just the parameter type and return type of the method must match the parameter type and return type of the delegate. This makes the commission fully suitable for "anonymous" calls. 1.3.4. "Event" in the event C # is a method of providing notifications when the objects occur when some interesting things happen. The most common use of events is for graphical user interfaces; usually, the classes representing the controls in the interface have some events, which events will be notified when the user performs some operations (if clicked with a button).
But the event is not only available for the graphical interface. Events provide an object to a very useful way to issue signal indicating status changes, which may be useful for customers of the object. Event is an important structural block for creating classes, which can be reused in a large number of different programs.