- Learn C# in 7 days
- Gaurav Aroraa
- 330字
- 2021-07-08 09:51:21
Understanding a typical C# program
Before we start writing a program in C#, let's first go back to day one, where we discussed the various IDEs and editors that are helpful in writing programs/applications using the C# language. Revisit day one and understand various editors and IDEs and check why we should go with one of our choice. We will be using Visual Studio 2017 update 3 for all our examples in this book.
To get start with a simple C# program (we will create a console application), follow these steps:
- Initiate your Visual Studio.
- Go to File | New | Project (or ctrl +Shift + N).
- Under Visual C# node, select .NET Core and then select Console App.
- Name your program, say, Day02, and click on OK (see highlighted text in the following figure):

You will get the following code in class Program.cs – this is the default code provided by Visual Studio; you can amend it as per your need:
using System; namespace Day02 { class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); } } }
By hitting the F5 key on your keyboard, you will run the program in Debug mode.
You can see the following output when the program runs:

Before moving further, let's analyze the following figure of our console application on Visual Studio:

The preceding figure depicts a typical C# program; we are using Visual Studio, but the console program remains unchanged across different IDEs or editors. Let's discuss this in more detail.
- Mastering Ext JS(Second Edition)
- Reporting with Visual Studio and Crystal Reports
- 深入理解Bootstrap
- Azure IoT Development Cookbook
- The Data Visualization Workshop
- Quarkus實踐指南:構建新一代的Kubernetes原生Java微服務
- Cocos2d-x學習筆記:完全掌握Lua API與游戲項目開發 (未來書庫)
- 利用Python進行數據分析(原書第3版)
- Oracle GoldenGate 12c Implementer's Guide
- Python自然語言理解:自然語言理解系統開發與應用實戰
- Mastering ASP.NET Core 2.0
- Less Web Development Cookbook
- Java編程指南:語法基礎、面向對象、函數式編程與項目實戰
- Unity虛擬現實開發圣典
- Tkinter GUI Application Development Blueprints