C # The first day of basic learning (the path to growth of. net cainiao-No foundation to proficient ),

Source: Internet
Author: User

C # The first day of basic learning (the path to growth of. net cainiao-No foundation to proficient ),

1. Concepts of Net platform and C # Programming Language

2. desktop applications:

To use a desktop application, you must install the client of the application.

Winform application.

Application: Application

Internet: Internet application Asp. Net

3. Two application modes:

C/s: Client/Server: desktop application. A client must be installed.

B/s: Browser/Server: internet application, you only need to install a browser

4. What is your commonly used IDE?

5. Open

---> Double-click shortcut

---> Windows key + R: Call and run. Enter devenv

Msconfig: Set the startup Item

Mspaint: Open the drawing tool

Calc: Calculator

Cmd: Command Line

6. vs operations

View menu ----> solution Resource Manager

Properties: Properties

---> AssemblyInfo. cs: a basic description of our application

Namespace:

A ---> ProjectA ---> customer

B ---> ProjectB ---> customer

C ---> ProjectC --->

A ---> ProjectA ---> customer

B ---> ProjectB ---> customer

7. Components in the code

Namespace: namespace or project name

Class: modifier class

Main: Main function, which is the Main portal of our application. Each application can have only one Main portal.

Solution: Company

Project: Department

Class files: Employees

A solution can contain multiple projects, and a project can contain multiple classes.

Solution Folder:

. Sln file: solution file, which contains information about the entire solution. You can double-click it to open it.

. Csproj: project file, which can be opened by double-clicking

8. Two lines of simple code

1) when the code is complete, we should generate a solution to troubleshoot syntax errors.

2) If there is a syntax error, you should correct it immediately. If there is no syntax error, you can run it.

Start shortcut: F5 Console. WriteLine ("content to output to Console"); Console. ReadKey (); pause, wait for you to press any key to continue. Any key that you press is displayed on the console. ABC ()()()()()()(),,,,,,,..........

Note: All punctuation marks in the Code must be half-width English characters, and the paired punctuation marks must be used together in the Console. writeLine (""); Console. writeLine ("utilities, etc.");

9. Compiler

---> Path C: \ Windows \ Microsoft. NET \ Framework64 \ v4.0.30319

---> Configure the environment variable (so that we can directly configure csc.exe in the command line)

---> Use cd to enter the path of the Code File

---> The csc compiler compiles code files.

---> Generate the. exe executable file and double-click it to open it (directly input the file name without the extension in the command line)

10. settings in

Zoom in or zoom out Font: ctrl + scroll wheel tool ---> options ---> set font in font and color

Commonly used shortcut keys in vs Ctrl + K + D: Quick alignment code Ctrl + Z: Undo Ctrl + S: Save (always save !) Ctrl + J: The Smart prompt "Shift + End", "Shift + Home Ctrl + K + C" is displayed quickly. Comment the selected code Ctrl + K + U: uncomment the selected code F1: go to the help document to fold the redundant code: # Region and # EndRegion

11. annotator in c #

Two Functions of the annotator: the first function is to deregister the code you wrote.

The second role is to explain the code you have written.

3 annotators: 1), single line comments // 2), multi-line comments/* content to be annotated */3), document comments /// mostly used for annotation classes or methods.

12. Variables

What variables help us do in a program is to store data.

Yating: 1 person Single Room 111 yating and female colleagues: 1 male and 1 female double rooms 521 yating and male colleagues: 2 male double rooms and 2 beds 222 when we went to open the room, we found that, when the Gender and number of people who open the room are different, the type of the room we open is different.

When we store data in the memory, the types of space we open in the memory vary according to the data types we store.

For example, I want to store the integer 100 in the memory. Int number = 100; in c #, the medium number does not mean equal to, but indicates assigning the value on the right of the equal sign to the variable on the left of the equal sign.

Use the variable Syntax: variable name = value of the variable type;

13. Common Data Types in c #

Int: Integer type. Only integers can be stored.

Double: decimal type. It can store decimals and integers with a range greater than int.

String: string type. required. Both sides of the value must be enclosed in double quotation marks. It can be null.

Char: character type. required. The value must be enclosed by single quotes in English. A maximum of one character can be stored.

Decimal: monetary type. The final m value is required.

14. Usage rules of variables:

Variables must be declared, assigned values, and finally used.

Note: repeated declarations or definitions of variables are not allowed.

Note: The variable can be reassigned without stopping. After being re-assigned, the old value no longer exists.

15. variable naming

When naming a variable, the first thing we need to satisfy is that the variable name must be meaningful.

Naming rules:

1 must start with a letter. -- do not start with a number.

2. It can be followed by any letter, number, or underline.

Note: 1) do not repeat the variable name in the c # system with the keyword. When you code, you find that the color turns blue, and the word is the keyword.

2) in c #, The Case sensitivity is. 3) when the same variable name cannot be repeatedly defined (otherwise, it is not rigorous), the variable name must be meaningful.

C # language is a strong language:

1) strictly case sensitive.

2) We must have a clear definition of the data type.

Naming rules:

1) Camel naming rules, also known as Camel naming rules, are mostly used to name variables. The Camel Naming Convention requires that the first letter of the variable name be in lowercase, and the first letter of the other words be in uppercase. Int studentScore = 100; string highSchoolStudentName = "James ";

2) Pascal naming rules are mostly used to name classes or methods. The first letter of each word must be in upper case, and the other letters must be in lower case. StudentScore HighSchoolStudentName

16. Value assignment operator

= Indicates the value assignment. The expression connected by equal signs is called the value assignment expression. Int number = 10; equal signs must be of the same data type.

17. Summary of commonly used software XMind youdao note Kingsoft typos NotePad

Job: Summarize the code of the day and write it twice a day.

 

In the next 3-6 months, I will share my study notes and materials every day! They are all the latest! I spent seven thousand yuan in the course of registration! If you really want to learn, you can leave your mailbox. I will send you a complete package! Stay tuned for my updates!

 

Video address: http://yunpan.cn/cQipijnpkIHaz access password 127f

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.