. NET Framework win (Part 1) (1)

Source: Internet
Author: User

. NET Framework win (Part 1) (1)

[Author: Panasonic guest added: 8:09:43]

! [<H3> <B> 1. Basic Concepts </B> <P class = "content">.. NET Framework is a development, deployment, and operation.. NET application environment, including ASP.. net, Common Language Runtime Environment (CLR), and. net Framework class. There have been many introductions about ASP. NET and CLR, but the introduction of. NET Framework classes is relatively rare.
<P class = "content">. net Framework class is also the system class, which provides a large number of ASP. NET application (and non-Asp. NET application) core functions that can be used. The system class can be used in all. NET languages, so we can regard the system class as a. Net windows
API. Unlike windows APIs, the system class provides advanced interfaces similar to com, which are quite easy to use.
<P class = "content"> As with all other. Net classes, the system class also exists in the form of assembly .. The Assembly in net is similar to the com DLL or EXE file-it is the execution file that saves class code. For example, the math class (including its attributes and method definitions) is located in the mscorlib. dll assembly .. Net has two types of Assembly: private assembly and shared assembly. Private assembly is an assembly of a single application, usually located in the bin directory of the application; in contrast, shared assembly can be used for multiple applications, and it should be loaded to the global assembly Buffer by the Assembly creator (equivalent.. net ).. Net
All the System Classes belong to the shared assembly.
<P class = "content"> if you have used Windows API programming, you must know that the difficulty in using Windows API is that it is difficult for us to identify and find out which function to call. In Windows API
There is no way to organize functions in the DLL. It looks like all API calls are randomly stacked into a large DLL. Fortunately, the. NET class is organized into a level called namespace according to the logical relationship. For example, the math class is a member of the system namespace. Namespaces can be nested in multiple layers. For example, the adoconnection class is a member of the system. Data. Ado class.
<H4> <B> 1.1 reference a member in the namespace </B> </H4>
<P class = "content"> to use the class in the namespace, you must follow the namespace hierarchy to find the class to be used. the separated names explicitly reference the class. For example, to create an adoconnection object, we must use code similar to the following (all examples in this article use visual
But no matter which. Net Language, the basic concepts are the same ):
<P class = "content"> <Table bgcolor = "# e9e9e9" cellspacing = 0 cellpadding = 5 width = 80% border = 1 bordercolorlight = "black" bordercolordark = "# ffffff"> <tr> <TD> <PRE> <P class = "content">
Dim CNX as system. Data. SQL. sqlconnection
CNX = new system. Data. SQL. sqlconnection (_
"Server = (local); uid = sa; Pwd =; database = pubs ")
</PRE> </TD> </tr> </table>

<P class = "content"> In addition to the above method, we can also use the import command to simplify the reference to the class. For example, the following code tells ASP. NET to import the system. Data. SQL namespace to the current page:
<P class = "content"> <Table bgcolor = "# e9e9e9" cellspacing = 0 cellpadding = 5 width = 80% border = 1 bordercolorlight = "black" bordercolordark = "# ffffff"> <tr> <TD> <PRE> <P class = "content">
& Lt; % @ import namespace = "system. Data. SQL" % & gt;
</PRE> </TD> </tr> </table>

<P class = "content"> after importing a namespace, we can directly reference the class name, omitting the namespace description before all class names. The code for creating an adoconnection object is:
<P class = "content"> <Table bgcolor = "# e9e9e9" cellspacing = 0 cellpadding = 5 width = 80% border = 1 bordercolorlight = "black" bordercolordark = "# ffffff"> <tr> <TD> <PRE> <P class = "content">

Next page 8

Related content:

-VB. NET Chinese tutorial (13) Whole-part relationship
-VB. NET Chinese tutorial (12) shared Member (shared Member)
-VB. NET Chinese tutorial (11) prototype Style
-VB. NET Chinese tutorial (9) overriding Program
-VB. NET Chinese tutorial (8) Basic concepts of Object

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.