03-01 The Anatomy of a Simple C# Program

Be aware that all C# keywords are lowercase (e.g., public, lock, class, dynamic), while namespaces, types, and member names begin (by convention) with an initial capital letter and have capitalized the first letter of any embedded words (e.g., Console.WriteLine, System.Windows.MessageBox, System.Data.SqlClient).

注意到所有C#的关键字都是小写字母,而命名空间,类型和成员名开始为大写字母并且每个内嵌的字母都要大写。

Every executable C# application (console program, Windows desktop program, or Windows service) must contain a class defining a Main() method, which is used to signify(;意味) the entry point of the application.

每一个可执行的C#应用程序必须包含一个类来定义Main()方法用来标示应用程序的入口点。

Formally speaking, the class that defines the Main() method is termed the application object. 

正式说来,定义Main()方法的类成为应用程序对象。

While it is possible for a single executable application to have more than one application object (which can be useful when performing unit tests), you must inform the compiler which Main() method should be used as the entry point via the /main option of the command-line compiler, or via the Startup Object drop-down list box, located under the Application tab of the Visual Studio project properties editor (see Chapter 2).

posted @ 2015-02-09 17:45  海川0  阅读(57)  评论(0)    收藏  举报