C # Introduction to common class libraries (1)

Source: Internet
Author: User
Tags mscorlib

We know the installation is complete. NET Framework, there are a lot of class libraries, some classes may not be used for a lifetime. however, you probably know which classes are available and can easily find them when you want to use them later. the so-called class library is a lot of things that Microsoft has done for you, just give it a simple call. here we will mainly talk about it.. NET 2.0, 3.0, and 3.5 class libraries.

Class Library Organization
To view all the information in the class library, open the Object Browser and select the corresponding one from the Browse drop-down list. NET version. then you will see a list on the left, which contains mscorlib, System, and System. data. these names correspond to dll files, for example, 2.0, you can go to C: \ Windows \ Microsoft. NET \ Framework \ v2.0.50727 directory find all the corresponding dll.

However, if we want to use the class library, we will not use using to call the dll, but use using to reference the namespace. multiple namespaces may be involved in a dll file. For example, the dll named "System" contains "System. IO, System.. Net and other namespaces. conversely, a namespace can exist in multiple dll files. For example, both mscorlib and System dll files include System and System. i/O. we only need to pay attention to the namespace When referencing it.

In addition, we can see that the dll name or namespace name are separated by many points, such as System, System. IO, System. net, System. net. cache. in fact, this is just a bit like a name. It conveys a bit of information through the name and serves as a comment. In addition, they do not have much to do with it. system. IO does not mean that it is a sub-space under the System. they are completely unrelated.

Since the dll and namespace are many-to-many relationships, even if you add the System dll to the reference and use the using System, however, you may not be able to use the class libraries in this namespace. it is possible that some classes in the System namespace are in the mscorlib dll. however, since VS adds common dll files to you by default, the namespace is also referenced by using by default. so you don't have to worry about it. however, if some namespaces are not commonly referenced, you have to be careful.

 

Next we will discuss the class library in. Net 2.0 in the unit of assembly (dll), rather than the namespace.
 

System. Xml

System. the dll in Xml contains System. xml, System. xml. schema and other namespaces. as the name implies, an Xml class library involves Xml operations. for example, before operating xml, we usually like to instantiate a class XmlDocument doc = new XmlDocument (). This class is the namespace System..

 

System. Windows. Forms

This dll contains System. windows. forms, System. windows. forms. design and other namespaces. if you want to develop a desktop application, that is, to use winforms one by one, you must use the class below this class library. most of the time, we only need to drag the control in the Toolbox, and then VS automatically adds a namespace reference to you. you only need to manually call some classes when you need to dynamically create and delete some controls.

 

System. Web. Services, System. Web, System. Web. RegularExpressions, System. Web. Mobile

There is a Web here. As the name suggests, all of them are Web-related and network-related. if you use C # To develop desktop applications, these class libraries are rarely used. of course, if you develop an application of the so-called C/S mode, it may be used. for example, System. web. the class library in Services. there are SOAP-related classes.

System. Web. Mobile is related to Mobile devices. If you develop applications on your Mobile phone, you may need to use the class libraries.

The controls you need to drag during WebForm development are basically in the System. Web. Web. UI. WebControls namespace in the dll System. Web.

 

System. Transactions

The classes in this dll seem to be related to transactions. We are familiar with the concept of transactions when using databases. if you use C # To write code to connect to the database and perform some operations, it seems that you can use this class to implement some transaction functions. I don't know how to use it, but I have never used it.

 

System. ServiceProcess

If you create a windows Service Program, the class library is used. right-click "computer", select "manage", and open a page where Services and Applications are displayed. Click "Services" and you will see a long list on the right, it shows some service programs. If you have installed Oracle server, you can start or close Oracle server here.

However, I have never used this kind of library class. I don't know how to use it. I will study it again when I have time.

 

System. Security

As the name suggests, there is a class library in this dll that is related to encryption. for example, System. security. cryptography namespace, we need to use this namespace if we want to use Des encryption, but note that the classes in this namespace do not exist in the System. security dll contains some classes in mscorlib and System.

 

System. Runtime. Remoting System. Runtime. Serialization. Formatters. Soap

The first Reomoting is naturally a class library related to remote calls, which is soap-related. I have never played any of these classes. I found that I have never used too many class libraries, and I am a bit ignorant.

 

 

System. Messaging

The class library is used for MessageQueue operations. The message here does not seem to be the message mechanism that is often mentioned in C ++. it refers to messages transmitted between different computers and data transmitted. I have never used it, and I don't know how to use it.

 

System. Management

The above shows that a pile of class libraries have never been touched, and this will finally come into use, and it looks pleasing to the eye. you need to use the class library here to obtain the memory, operating system type, and manufacturer information on your computer.

For example, use System. Managment as the class in the namespace below.

ManagementObjectSearcher query = new ManagementObjectSearcher ("SELECT * From Win32_OperatingSystem ");

ManagementObjectCollection queryCollection = query. Get ();

// QueryCollection this is a collection that contains a lot of information. You can parse all the information you want one by one.

 

System. EnterpriseServices

Ah, I have encountered something I have never seen before, and I don't know what it is. I guess it's web-related, remote calls, and so on.

 

System. Drawing, System. Drawing. Design

This time, I am familiar with it, and it is easy to say that the class related to drawing is called GDI (Graphics Device Interface)

 

System. Design

Class Libraries related to the control layout, such as WinForm and WebForm.

 

System. DirectoryServices, System. DirecotryServices. Protocols

It is mainly a class library related to the Active Directory. the Active Directory is a very important feature in windows. The C # compiled by Microsoft itself naturally requires more class libraries to support some features of windows.

 

System. Configuration. Install, System. Deployment

If you want to integrate your application into an installation file, you can use the class library here to perform some operations. In addition, you can also update programs in the future.

 

System. Data

It mainly supports database-related operations. For example, it supports Microsoft's own database SQL Server or other databases, but it is connected through odbc.

 

System. Configuration

Perform operations on the class libraries related to configuration information. For example, when you develop a web application, you will see a Web. config file. The class libraries here will be used for operations.

 

System mscorlib

The class libraries in these two dll files are the most used. this demonstrates the principle. the above class libraries may only account for 20% of all class libraries, but they may account for 80% of the importance. you have to sort it out and discuss it separately.

 

 

Related Article

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.