CSharp-Learning/README.md

103 lines
3.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# C# Learning
C# 学习仓库,包含课程笔记和示例代码。
## 环境准备
### 安装 .NET SDK 8.0(必选)
> 当前推荐版本:**.NET 8.0.26**2026年4月发布
**方式1官网下载点击下载**
<a href="https://dotnet.microsoft.com/download/dotnet/8.0" target="_blank" rel="noopener noreferrer">点击下载 .NET SDK 8.0Windows x64</a>
**方式2命令行安装推荐**
Windows 使用 winget
```bash
winget install Microsoft.DotNet.SDK.8
```
**方式3其他系统**
```bash
# macOS
brew install dotnet@8
# Linux (Ubuntu)
wget https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt update
sudo apt install dotnet-sdk-8.0
```
**验证安装:**
```bash
dotnet --version
# 应显示 8.0.26 或更高版本
```
### 编辑器推荐
- **VS Code** + C# Dev Kit免费
- **Rider**(跨平台,强大)
- **Visual Studio**Windows 功能最全)
---
## 课程目录
### C# 基础Lesson 01-10
| 课时 | 内容 | 代码 | 笔记 |
|------|------|------|------|
| Lesson 01 | [Hello World](./lessons/Lesson_One/) | [Program.cs](./lessons/Lesson_One/Program.cs) | [笔记](./notes/01_CSharp_Basics.md) |
| Lesson 02 | [变量和数据类型](./lessons/Lesson02/) | [Program.cs](./lessons/Lesson02/Program.cs) | [笔记](./notes/02_Variables_and_Types.md) |
| Lesson 03 | [条件判断和循环](./lessons/Lesson03/) | [Program.cs](./lessons/Lesson03/Program.cs) | [笔记](./notes/03_Conditions_and_Loops.md) |
| Lesson 04 | [方法和类](./lessons/Lesson04/) | [Program.cs](./lessons/Lesson04/Program.cs) | [笔记](./notes/04_Methods_and_Classes.md) |
| Lesson 05 | [多文件项目和访问修饰符](./lessons/Lesson05/) | [Program.cs](./lessons/Lesson05/Program.cs) | [笔记](./notes/05_MultiFile_and_Access_Modifiers.md) |
| Lesson 06 | [继承和接口](./lessons/Lesson06/) | [Program.cs](./lessons/Lesson06/Program.cs) | [笔记](./notes/06_Inheritance_and_Interface.md) |
| Lesson 07 | [集合 List 和 Dictionary](./lessons/Lesson07/) | [Program.cs](./lessons/Lesson07/Program.cs) | [笔记](./notes/07_Collections.md) |
| Lesson 08 | [异常处理](./lessons/Lesson08/) | [Program.cs](./lessons/Lesson08/Program.cs) | [笔记](./notes/08_Exception_Handling.md) |
| Lesson 09 | [文件读写](./lessons/Lesson09/) | [Program.cs](./lessons/Lesson09/Program.cs) | [笔记](./notes/09_File_IO.md) |
| Lesson 10 | [委托和事件](./lessons/Lesson10/) | [Program.cs](./lessons/Lesson10/Program.cs) | [笔记](./notes/10_Delegates_and_Events.md) |
### 进阶
| 课时 | 内容 | 代码 | 笔记 |
|------|------|------|------|
| Lesson 11 | [WebView2 入门](./WebView2Demo/) | [代码](./WebView2Demo/) | [笔记](./notes/11_WebView2_Basics.md) |
## 运行示例
```bash
# 进入课程目录
cd lessons/Lesson_One
# 运行
dotnet run
```
## 项目结构
```
CSharp-Learning/
├── lessons/ # 课程代码
│ ├── Lesson_One/ # Hello World
│ ├── Lesson02/ # 变量和数据类型
│ ├── Lesson03/ # 条件判断和循环
│ ├── Lesson04/ # 方法和类
│ ├── Lesson05/ # 多文件项目
│ ├── Lesson06/ # 继承和接口
│ ├── Lesson07/ # 集合
│ ├── Lesson08/ # 异常处理
│ ├── Lesson09/ # 文件读写
│ └── Lesson10/ # 委托和事件
├── notes/ # 课程笔记
├── WebView2Demo/ # WebView2 集成示例
└── README.md
```
## 作者
Rosmontis_Cloud