Unity-C#编写第一个程序

我的文章

步骤

1:打开Visual Studio
2:文件-新建-项目-Visual C#-控制台应用
3:名称命名为:01学习VS(命名支持中文英文,但不能包含的字符有:;(/?:&*“<>|#%;;)),位置可任意放到其他D盘,然后点确定
4:按照以下代码写

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _01学习VS
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello world");
}
}
}

5.按Ctrl+F5弹出命令控制台,你会看到输入的代码Hello world

总结

刚开始学习编程的时候先不要问为什么,先模仿着来做,多练习,等累积到一定的经验之后再回首来看以往的问题即可迎刃而解。