April October 9, 2014-language basics 1

Source: Internet
Author: User

Class Library, referenced, called

Namespace (can contain multiple classes)

Class. CS files, storing code

Main function static void

Code

. Config stores configuration parameter files

. Csproj project file

. Sln solution, Project Management

 

Alt + → prompt,

CTRL + k, and then press Ctrl + C to comment out the line

CTRL + k, and then press Ctrl + u to cancel the comment

Remove the following brackets and write them again. The Non-Alignment rows will be automatically rearranged.

 

Three methods of annotation ://,/**/,///

How to change the font-→ tools-options-environment-fonts and colors

 

How to change the row number-→ tools-options-Text Editor-row number

 

/* Useing indicates the library referenced by the program, and the following system indicates that these libraries are created on the console. Netframework2.0 provides */using system; using system. collections. generic; using system. LINQ; using system. text; using system. threading. tasks;/* when creating a project, a namespace is automatically created, that is, the namespace can control the scope of classes and variables */namespace helloworld {/* class indicates the class, C # is an object-oriented language. When all programs have classes that constitute the Project Creation, Vs will automatically create this program class */class program {/* main is the main function, the program starts from */static void main (string [] ARGs) {console. writeline ("Hello! World !!! "); Console. Readline (); // This is to prevent the console from exiting immediately }}

I. Data Types

1. Value Type

Integer: the unsigned integer is twice the positive number of the signed integer plus 1.

. That is, uint = 2 x int + 1.

Signed integer: sbyte, Int, short, long (commonly used)

Unsigned integer: bytre, uint, ushort, ulong

 

2. floating point:

Float

Decimal

Double,

3. Balanced type:

Char Si = 'ffddfsd' single quotes

4. boolean bool is used to judge

True and false,

5, string

String is equivalent to character type and has a long length. It is defined as double quotation marks.

6. Date and Time types

Datetime,

7. Enumeration type

Enum

Enum days {sat, sun, Mon, Tue, wed, Thu, Fri };

8. Structure Type

Struct is usually used to encapsulate small variable groups,

For example, coordinates of a rectangle or features of an inventory item.

The following example shows a simple structure declaration.

Public struct book

{

Public decimal price;

Public String title;

Public String author;

}

2. Reference Type

1. string type

String represents a Character Sequence (zero or more Unicode characters ). String is the alias of string in. NET Framework.

String A = "hello ";

String B = "H ";

2. class type

All other types of final base classes of the object

Class A {sasasasa} code, user-defined type

3. Interface Type

Interface

4. array type

One-dimension and multi-dimensional arrays, such as int [] and INT [,]

 

April October 9, 2014-language basics 1

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.