Other C # knowledge

.NET understood as a runtime environment and a comprehensive base class library.

.NET three key entities (building blocks): the CLR, the CTS, the CLS  

The common language runtime layer to the CLR  . Function: positioning load and manage .NET type. It is also responsible for low-level tasks such as memory management, thread handling, and so on.

Common Type System: CTS  . It describes the runtime of all possible data types and programming constructs supported.

Common Language Specification: CLS. All defined subset of the common types and programming structure of .NET that are supported.

Reflector view assemblies, decompile.

Three-tier architecture

Three-tier architecture is divided into UI (presentation layer), BLL (business logic layer) DAL (Data Access Layer)

 

 

The purpose of using three-tier architecture is decoupled. Any changes will not affect the layer to another layer. Clear structure, high maintainability, is conducive to the development of synchronization.

Ref and out what's the difference?

Out output parameters do not need to initialize, Ref reference parameter must be initialized.

It is used to return both the primary function of a plurality of values

For example:

 class test
    {
        public int getParts(double n, out double frac)
        {
            int whole;

            whole = (int)n;

            frac = n - whole; //pass fractional小数 part back through frac 
            return whole;     //return integer portion 返回整数部分   
        }
        class Program
        {
            static void Main(string[] args)
            {

                test Tout = newTest ();
                 int I;
                 Double F; 
                I = Tout.getParts ( 12666.56789 , OUT F); 
                Console.WriteLine ( " integer part: " + I); 
                Console.WriteLine ( " . decimal part: {0: # ## } # " , f); 
                Console.WriteLine ( " fractional part: " + f); 
                Console.ReadKey (); // listen for keyboard events, press any key to exit executed 

            } 
        } 
    }

Results are as follows:

Members Overload: When a member of the same name defined in a group (the number of them is not the same type or parameters), such a member is called overloading. 

The C # + compiler symbols are processed String.Concat () call.

 

Guess you like

Origin www.cnblogs.com/cdjbolg/p/11756794.html