.NET 教學課程 - 5 分鐘的 Hello World

編輯您的程式碼

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/9/16 下午10:40:21