A journey of a thousand miles begins with a single step. Mastering a certain skill begins with the most basic thing. Learn new things with a gentle understanding. When you do things in different situations and at different times, you will always get unexpected experiences and gains.
First, start with the Main method,
[Csharp]
1. // The using keyword is used to introduce an "external assembly". System is the most basic assembly of the. net platform provided by Microsoft. All. net programs must reference this assembly.
2. using System;
3. // namespace. A class can belong to a namespace, or multiple classes can be in the same namespace;
4. // prevents class name conflicts. That is to say, different namespaces can have classes with the same class name. Of course, in standard code, namespaces can organize class levels,
5. // For example, the company name, project name, Module name, and project level are clear at a glance.
6. namespace YYS. CSharpStudy. MainConsole
7 .{
8. // C # is a pure object-oriented language. Classes are the basis of all code, and class keywords can define a class.
9. class Program
10 .{
11. // The Main method is the entry for project startup, and the program starts to run from Main. String [] args is a console parameter that is passed in from the console by the program running.
12. // the standard format is as follows.
13. // <summary>
14. // Main method
15. /// </summary>
16. // <param name = "args"> </param>
17. static void Main (string [] args)
18 .{
19. Console. WriteLine ("Hello, World! ");
20.
21. Console. ReadKey ();
22 .}
23 .}
24 .}
Author: yysyangyangyangshan