当前位置:网站首页>ASP. Net and Net framework and C #

ASP. Net and Net framework and C #

2022-06-26 07:46:00 Liuyi

Hello , Is my ryukyu and yi .
Let's talk about it today ASP.NET And .NET Framework and C# The relationship between .

At the beginning ASP.NET Before , We need to understand the following operation first ASP.NET Development platform of .NET frame . If you've learned C# So right. .NET The framework will have a certain understanding . When you're writing ASP.NET You'll find that ASP.NET The code and C# Similar or even equivalent to . Then you must have some questions . What is the relationship between them ? Let's see .

One 、.NET Framework Introduce
Microsoft.net yes 2000 year 6 month 22 On the th, Microsoft launched to the world , New software development and service platform , The purpose is to provide strong services to customers all over the world 、 Personalized Internet services . from 2002 The original version was released in 1.0, To 2012 Officially launched in 4.5, I've experienced 1.0、1.1、2.0、3.0、3.5 、4.0、4.5、4.7 Eight versions .

 picture .png

.NET The core of .NET Framework(.Net frame ) yes .NET Environment for program development and operation , Under this platform, it can be developed in different languages , because .NET It is a cross language platform . Language can be C#,F#,Visual Basic.NET wait .JAVA and .NET The difference is java It's cross platform , Not cross lingual ..NET Cross platform is limited to Android and IOS Apple system .

1、.NET Framework It contains the following two main components :

CLR: Common language runtime (Common Language Runtime), Provide internal management , Code security detection and other functions .

FLC:.NET Framework class library (.NET Framework Class Library), Provide a large number of application class libraries , There are many thread resources available in the class library ( such as : class 、 Method 、 attribute ) Increase of efficiency .

Its underlying structure is shown in the figure :
 picture .png
2、 Common language runtime (CLR)

.NET Framework At the core of is the execution environment of its runtime , Called the common language runtime (CLR) or .NET Runtime . Usually will be CLR The code that runs under the control of is called managed code .

CLR Mainly responsible for compiling and running managed code . stay .NET The compilation of the code in is divided into two stages :

(1) Compile the source code into Microsoft Interlingua (MSIL Microsoft Intermediate Language).

(2)CLR hold MSIL Compile into platform specific machine code .

3、CLR Structure

CLR The structure of the consists of the following three parts :

①CLS: Common language specification , Get all kinds of languages into a unified syntax .

②CTS: General type system , Convert data types in various languages into unified types

③JIT: Real time compiler ( Just in time compiler ) It is used to compile the converted language into binary language , hand CPU perform .

4、.NET Framework class library (FCL)

.NET The framework class library provides classes to realize basic functions , For example, input and output 、 String operation 、 Network communication, etc .

.NET Framework in , All namespaces are from System Formed by the namespace of .System Namespaces are also called root namespaces . The function of the corresponding namespace is shown in the figure below :

 picture .png

【 If you haven't followed me yet , You can pay a little attention to , Update the article every day and I'll inform you .】

Two 、C#

With .NET The birth of the platform , Microsoft has launched the cooperation .NET Platform application development language ——C#(C Sharp).

Study C# Language , What kind of program can be developed ? The program that can be developed is shown in the figure below :

 picture .png

C# It's a .NET A programming language under the platform , It's just a language . Is running on the .NET CLR Upper , High level language for creating applications . Programming language is a tool to facilitate communication between developers and computers .

C#.NET The application compilation steps are as follows :

1、 Use C# Write application code in ;

2、 hold C# The source program is compiled as Microsoft Interlingua (MSIL Microsoft Intermediate Language), Exists as an assembly ;

3、 When executing code , You have to use JIT The compiler compiles the assembly into native code ;

4、 In escrow CLR Run native code in the environment , The program execution results are displayed ;

3、 ... and .ASP.NET

ASP.NET Microsoft's .NET The system provides Web Development framework , Website development technology is , yes .NET An application model in the framework , Used to generate based on Web Content rich programming framework for your application . Use ASP.NET Development Web Applications and keep them running , Simpler than other development languages . And Java、PHP and Per Compared with advanced technology ,ASP.NET It's convenient 、 flexibility 、 High production efficiency 、 High security and object-oriented , Is one of the mainstream network programming technologies .

ASP.NET Support 3 Development mode :

1、Web Pages

Web Pages It's development ASP.NET The simplest development mode of web pages . It provides a simple way to HTML、CSS、JavaScript Combined with server script :

(1) Easy to learn , Easy to understand , Easy to use ;

(2) Create around a single web page ;

(3) And PHP And classic ASP be similar ;

(4) Visual Basic perhaps C# Server script ;

(5) whole HTML、CSS and JavaScript control ;

Web Pages Built in database 、 video 、 graphics 、 Social media and more Web Helpers, So it's easy to expand .

This module can be developed and used separately , It can also be in MVC Used in combination with the template of the view in .

2、Web Forms

Web Forms There are three ways to create ASP.NET Website and Web One of the programming patterns of an application .

The other two programming modes are Web Pages and MVC(Model View Controller Model - View - controller ).

Web Forms It's the oldest ASP.NET Programming model , It is integrated. HTML、 Event driven web pages for server controls and server code .

Web Forms Is compiled and executed on the server , Then generated by the server HTML Display as web page .

Web Forms There are hundreds of Web Controls and Web Component is used to create user driven websites with data access .

3、MVC

MVC It's a use MVC(Model View Controller Model - View - controller ) Design creation Web The pattern of the application :

(1) Model( Model ) Represents the core of the application ( For example, database record list ).

(2) View( View ) Display the data ( Database records ).

(3) Controller( controller ) Process input ( Write database records ).

MVC The pattern also provides for HTML、CSS and JavaScript Full control of .

This development model is widely used in enterprises , Focus on mastering this development mode .

Four 、 The book I wrote is on pre-sale !

I'm writing a book recently 《ASP.NET Web Dynamic website 》 The book of development , expect 2 By the end of the month , Coming soon ~

If you need a small partner, you can book it in advance ~
Reservation website :http://www.71muke.com/course/...

More programming knowledge acquisition , You can pay attention to the official account. : Ryuki programming library .

原网站

版权声明
本文为[Liuyi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202170956408433.html