vs快捷键修改

代码注释 单行注释 Ctrl+K 然后Ctrl+C 注释 或者Ctrl+K+C ctrl+w选中代码块 shift+alt+= 代码格式化 ctrl+k+d

C#json

https://docs.microsoft.com/zh-cn/dotnet/standard/serialization/system-text-json-overview?pivots=dotnet-6-0

c#事件

Demo 事件声明完整格式 顾客-customer进入餐馆点菜(触发事件),服务员-waiter(收到事件并处理) namespace Exception { class Program { static void Main(string[] args) { Customer customer = new(); Waiter waiter =

C#入门

c#入门 打印 int a = 1 Console.WriteLine($"a is {a}") 分支和循环 if int a = 5; int b = 3; if (a + b > 10) { Console.WriteLine("The answer is greater than 10"); } else { Console.WriteLine("The answer is not greater than 10"); } for for (int index = 0; index < 10; index++) { Console.WriteLine($"Hello World! The index is {index}"); } var