Main 方法是程序的入口点,您将在那里创建对象和调用其他方法。一个 C# 程序中只能有一个入口点。
| C# | 复制代码 |
|---|---|
class TestClass
{
static void Main(string[] args)
{
// Display the number of command line arguments:
System.Console.WriteLine(args.Length);
}
}
| |
Main 方法是程序的入口点,您将在那里创建对象和调用其他方法。一个 C# 程序中只能有一个入口点。
| C# | 复制代码 |
|---|---|
class TestClass
{
static void Main(string[] args)
{
// Display the number of command line arguments:
System.Console.WriteLine(args.Length);
}
}
| |
概述
本节内容
C# 语言规范
请参见