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); } } |