.NET 教程 - Hello World 5 分钟

编辑代码

Program.cs 文件中,在打印 Hello, World! 的代码后面添加突出显示的行,如下所示:

Program.cs
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
Console.WriteLine("The current time is " + DateTime.Now);

保存 Program.cs 文件,然后再次选择“运行与文件关联的项目”。如果成功,应会看到类似于以下内容的输出:

Terminal
Hello, World!
The current time is 2025/4/22 下午8:04:18
继续