"Aps.net Frame Series" on ASP. NET Framework

Source: Internet
Author: User
Tags dotnet html form

This article slightly biased principle and the ground level, has certain difficulty and is quite obscure.

This article is mainly from the breadth of a summary, specific more granular, will be in the subsequent articles, combined with specific demo example analysis.

One. NET Framework Overview

1. Function: provided based on. NET Framework to develop the base platform and template for. NET development scaffolding;

2. Basic composition: Can support language, CLS, template framework, Basic template, basic operation, basic class library, public need to run, CTS and Cls,os etc;

(1) Languages supported:. NET Framework can support language development such as VB,C++,C#,F#,JS;

(2) CLS: A common language specification that makes it possible to develop multiple languages, with reference to

Https://docs.microsoft.com/en-us/dotnet/standard/language-independence-and-language-independent-components

(3) Template framework: b/S mode development, C/S mode development, app development, interface development

B/s:webform and Mvc,.net core, mainly PC application program;

C/s:winform and WPF, mainly desktop applications;

APP: The current mainstream of a development model;

(4) Basic operation: to DB operation (ADO and EF), I/O operation, etc.;

(5) BCL: Basic class library, for invocation;

(6) CLR: The common language runtime, is the IL to form an EXE is an essential part of the JIT implementation of a compilation, multiple and cross-platform operation of the necessary environment, in the. NET Framework plays an important role, and the technology is more difficult and obscure;

(7) CTS and Cls:cts, the common type System, implement COM component compatibility, etc.

(8) OS: Masking the underlying implementation, high abstraction, OS type: Win XP (Basic elimination, Microsoft is not officially maintained), Win 7, win 8,win 10;

3..NET two major products: Dynamic CRM and SharePoint;

(a) ADO

1. Role: One of the ways in which programs interact with data. NET Framework, ADO. NET abstract the interaction between the program and database, in the basic crud operation, only need to invoke the specific class, the method can be;

2. Basic composition: mainly composed of five major objects. Conneciton object, DataAdapter object, Command object, DataSet object, DataReader object composition;

3. Basic overview of five large objects:

(1) Connection object: The channel that connects the database, the main method is open () and close (), the former is responsible for opening the database entrance, the latter is responsible for closing the database portal;

(2) The Command object is responsible for the specific operation of the DB, and CRUD is implemented through it;

(3) The DataAdapter object is responsible for adapting the DB to the dataset so that the basic crud can be implemented;

(4) The role of DataSet object playing virtual memory, also playing the role of caching, is one of the necessary steps to realize the interaction between application and DB data.

(5) DataReader mainly solve the problem of reading data, the performance is relatively high;

4. Recommendation: Specific details, you can refer to MSDN, its overview of more detailed;

(ii) EF Framework

1. Role: For programmers to provide more convenient and efficient data manipulation, for the novice programmer, can quickly get started, extremely convenient (of course, experienced EF developers may have experienced the various pits of EF);

2. Three modes: DB first,code First,model first;

3. Basic Composition: Operation Tool (Linq to entity,entity SQL), objectservices,entity client,edm,ado.net Data Provider;

(1) LINQ to entity and entity SQL: provides two different ways to manipulate data;

(2) OBJECTSERVICES:DB Access portal for entity and data conversion;

(3) Entity Client: Responsible for translating LINQ to entity and Entity SQL into standard SQL;

(4) EDM: The transformation of conceptual model to storage model;

(5) ADO Data Provider: Realizing the interaction with the DB;

(iv) Program compilation process

1. The program compilation process can be broadly summarized

2. Operating in the console

Code:

1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.Linq;4 usingSystem.Text;5 usingSystem.Threading.Tasks;6 7 namespaceProgramrundemo8 {9     class ProgramTen     { One         Static voidMain (string[] args) A         { -             Doublesum = Addsum (10.5,9.5); -Console.WriteLine ("sum={0}", sum); the Console.read (); -         } -          Public Static DoubleAddsum (DoubleADoubleb) -         { +             returnA +b; -         } +     } A}
View Code

Here we compile the Addsum () method into a DLL file

Viewing IL code through the Anti-compilation tool. NET Reflector

Here we compile the source code with notepad++ and compile it with the csc.exe compiler of VS

Tip: When prompted in a DOS command: ' CSC ' is not an internal or external command, nor is it a running program or batch file.

Add the. NET csc.exe path to the system environment variable, and my csc.exe path is

C:\Windows\Microsoft.NET\Framework64\v4.0.30319

No, you can refer to the csc.exe path configuration

or refer to my other article "Java series" Java Development environment Building

List some of the more commonly used csc.exe commands

1 //compiling File.cs for generating File.exe2 csc File.cs3 4 //compiling File.cs for generating File.dll5csc/target:library File.cs6 7 //compile File.cs and create My.exe8csc/ out: My.exe File.cs9 Ten //compiles all C # files in the current directory, optimizes them, and defines the DEBUG symbols. Output is File2.exe OneCsc/define:debug/optimize/ out: File2.exe *. CS A  - //compiles all C # files in the current directory, generating a debug version of File2.dll. Do not display logos and warnings -Csc/target:library/ out: File2.dll/warn:0/nologo/debug *. CS the  - //compiles all C # files in the current directory to SOMETHING.XYZ (DLLs) -Csc/target:library/ out: something.xyz *.cs

For instructions on csc.exe, you can refer to MSDN:

Https://docs.microsoft.com/zh-cn/dotnet/csharp/language-reference/compiler-options/command-line-building-with-csc-exe

3. The compilation process can be broadly divided into two stages:

The first stage:. CS Code =>il Code, this compilation time is relatively slow

Phase two: Il+dll the target code through the CRL, which is a faster process

Let's think about it: why is the first stage slower and the second stage relatively fast? Will be mentioned in the following IL.

(iii) the CLR

1. Function: Memory management, exception management, multithreading management, GC management, etc. The CLR is an extremely important part of. NET and one of the more difficult and obscure technologies in the. NET Framework.

2. The CLR can be viewed as a Java virtual machine;

3.JIT Instant compilation, consisting mainly of three parts (main compiler, Prejit and Econojit)

4.JIT+CLR implementation of a compilation, multiple runs and can be cross-platform;

One of the more important aspects of 5.CLR is the pipeline (Pipes) (HttpModule and HttpHandler)

(v) MSIL

1.IL is. CS code compiled by the VS compiler csc.exe;

2.IL is closer to machine code but not machine code (this feature makes it il= ". EXE process faster);

3.IL Code is instruction-independent;

4. The IL code can be viewed through the Disassembly tool;

Second, b/s program operation analysis based on. NET Framework Framework

(i) Overview of the overall process

1.IIS when processing requests, divide the resources into two types: static resources and dynamic resources

Static resources: img,js,css,html, etc.;

Dynamic files: asp,asp.net,.aspx,.. ashx,asax, etc.;

2.IIS handles static resources:

When IIS receives a request from a browser that is recognized as a static resource, IIS directly processes the results back to the browser in HTML form;

3.IIS How do I handle dynamic resources?

When IIS receives a request from the browser that is recognized as a dynamic resource, IIS cannot process it at this time, handing it over to the ISAPI Extensions (ISAPI extender) extender, which is processing the program based on the request resource extension, looking for a response, such as an. asp file, or asp_ ISAPI processing

, if it is. aspx, ASPNET_ISAPI processing,

How does 4.IIS handle WebForm and MVC?

When IIS receives a request from the browser, which is recognized as a dynamic resource, IIS cannot process at this time, handing over to the ISAPI extensions processing, at which time the ASP. NET MVC HTTP handler identifies whether the request resource is MVC, and if so, gives the MVC route, Deal with the MVC approach, otherwise

, in accordance with the WebForm process;

What is the pipe (Pipes) inside the 5.CLR?

The nature of the pipeline is HttpModule and HttpHandler (general treatment procedures. ashx);

(ii) the CLR and pipe

(iii) TCP/IP model

1. This structure is the current comparative standard TCP/IP five-layer model, before the five-layer model becomes a general specification, there are seven-layer model and four-layer model two categories;

2. With regard to these five layers, the "computer network" prepared by Shehiren is more detailed and thorough, and the friends who feel the rise can go to see it;

3. Why should we mention TCP/IP? Very simple, we enter in the browser: http://www.google.com.hk/, in the process, TCP/IP is indispensable;

4. Do not say much here, will be in the follow-up article Webapi and HTTP protocol detailed explanation;

Three reference documents

"01" http://www.wrox.com/

"02" http://msdn.microsoft.com/en-us/library/system.web.httpapplication (v=vs.80). aspx

"03" ASP. MVC5 Advanced Programming (Jon Galloway,brad Wilson,k.scott allen,david Matson, Sun translation)

"04" ASP MVC5 Programming (3rd edition) (Dino esposite, Panli translation)

"05" ASP. MVC4 Development Guide (HUANGPAO)

"06" Computer Network (6th edition) (Shehiren)

Four copyright areas

    • Thank you for your reading, if there are shortcomings, welcome advice, common learning and common progress.
    • Bo main website: http://www.cnblogs.com/wangjiming/.
    • A very small number of articles using reading, reference, reference, copying, copying and pasting into a variety of ways, most of the original.
    • If you like, please recommend, if you have new ideas, welcome, email: [Email protected].
    • The blog can be reproduced, but must be well-known from the blog source.

"Aps.net Frame Series" on ASP. NET Framework

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.