Introduction to C# (C-Sharp) and Installation
Target Version: .NET 8 / 9 (LTS) Official Documentation: Microsoft C# Documentation
1. Overview of C#
C# is an object-oriented programming language developed by Microsoft and is the cornerstone of the .NET ecosystem.
- Features: Strongly typed system, Garbage Collection (GC), multi-paradigm (Object-oriented, Functional).
- Advantages: High productivity with full support from Microsoft.
- Application Areas: Game development using the Unity engine, enterprise servers (ASP.NET), and desktop applications (WPF/WinForms).
2. Development Environment (.NET SDK)
Windows users are highly recommended to install Visual Studio, while users on other platforms are encouraged to use the .NET SDK combined with VS Code.
Installing the .NET SDK
- Download from dotnet.microsoft.com/download.
3. Hello, C#!
using System;
namespace MyFirstApp {
class Program {
static void Main(string[] args) {
// Output to the console
Console.WriteLine("Hello, .NET Core LLC!");
}
}
}
Alternatively, with the latest versions of C#, you can use Top-level statements to write more concisely:
Console.WriteLine("Hello, Concise C#!");