带有.cs 后缀的文件表示通过C# 语言规范编写的源代码文件。
1 编写代码
使用System; 命名空间Dome{ 类Test { static void Main(string [] args) { Console.WriteLine('Hello C#'); } Console.ReadKey(); } }}使用记事本编写代码
2 编译代码
2.1 找到要使用编译器的csc.exe程序版本(以编译器4.0为例)
安装.Net Framework后,基本上可以在计算机上的这个位置找到csc.exe程序:C:\Windows\Microsoft.NET\Framework\v4.0.30319
2.2 打开dos窗口:电脑的开始菜单-所有程序-windows系统-命令提示符
只需“开始”--“运行”--cmd---回车即可进入DOS界面
编译C# 文件
D:\C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc Dome.cs 注意,Dome.cs文件路径必须为D:\Dome.cs(上图红框内的路径为示例) ,假设它是另一个文件路径
文件: D:\Dome\Dome.cs代表D盘下Dome文件夹中的Dome.cs。编译后的路径为
D:\C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe Dome\Dome.cs 无论使用上述哪个路径,编译出来的Dome.exe 程序路径都是D:\Dome.exe 的程序集
程序集:不是后缀为.exe或.dll的文件,它被称为程序集。必须是通过csc命令编译出来的.exe或者.dll文件,称为程序集;该程序集由MSIL(微软中间语言)组成
3 运行Dome.exe程序
简单的执行流程
不符合C#语法规范的代码
使用System; 命名空间Dome{ 类Test { static void Main(string [] args) { Console.WriteLine('Hello C#'); } Console.WrteLine('欢迎来到编程世界'); Console.ReadKey(); } } }Dos窗口下的错误信息

VS中代码的错误信息;只有两个错误。只要纠正这两个错误,其他错误信息就会消失。
使用VS写代码时,出错的代码很快就会有错误信息,可以立即改正。
不使用VS 编写代码会导致:1 代码中的语法或语句编写错误不易察觉2 必须牢记C# 语法规范;Net框架类库中要用到的类或者相关方法等。 3 代码编写、编译比较麻烦3 出现错误调试困难5. 整个程序系统的文件难以管理等诸多存储问题
有许多用于编写C# 代码的开发工具。选择使用VS的原因是版本不断更新,功能越来越强大。深受广大程序开发者的喜爱。不仅可以解决以上问题,VS还可以安装很多强大的插件等等。
最重要的是VS开发工具是专门为了配合程序员更高效地使用.Net来开发不同类型的应用程序而设计的。
IDE
IDE(Integrated Development Environment)集成开发环境:是用于提供程序开发环境的应用程序,一般包括代码编辑器、编译器、调试器和图形用户界面等工具。它是集成了代码编写功能、分析功能、编译功能、调试功能等的集成开发软件服务套件,凡是具有该功能的软件或软件包(组)都可以称为集成开发环境
不管是什么类型的IDE,总之它是一种帮助程序员更高效地开发程序的开发工具。
Visual Studio
Visual Studio是微软的开发工具包系列产品Microsoft Visual Studio(简称VS)
VS系列主要产品
最新的Visual Studio IDE是VS2022;最新的.NET框架是.Net 6.0
编辑C#源代码的‘工具’主要是使用左边第一个VS产品(以VS2013为例)
VS一共有三个版本,我个人推荐专业版。
社区(社区版)
也可以理解为个人版。适合学生、开源和个人。对于一些新手学习来说是一个不错的选择。该版本有比较完善的免费IDE。可用于开发Android、iOS、Windows 和Web 应用程序
Professional(专业版)

该版本为专业版。它不仅适合各种规模的团队开发,也适合个人使用。版本功能非常强大。它具有社区版和企业版的所有优点。
Enterprise(企业版)
适合开发团队和公司。该版本提供了一套丰富的专业开发人员工具、服务和订阅。与个人版本相比,可以保持高效率,并实现不同开发者领导之间的无缝协作。
关于VS的其他知识我就不详细说了。如果您有兴趣,可以在百度上搜索相关信息,了解更多;
如何下载,安装,破解VS
1 查找下载VS
通过某度、某号等浏览器在搜索框中输入“vs2013中文版下载”,打开相关网站进行下载。这类下载的VS一般都有破解功能。
找到VS下载网站,建议下载专业版
2 安装VS
安装方式有两种: 1)在线安装,安装时会自动下载相关安装文件; 2)离线安装包
详细的安装步骤可以自行去某网站查找,不再重复,以免产生填写字数的嫌疑。
注意:无论选择哪种安装方式,首先要知道自己电脑的操作系统是32位还是64位; 64位操作系统可以安装64/32位VS;如果你同时安装32位操作系统和64位操作系统,大概率会弹出错误窗口。
检查操作系统位数的方法有很多种,仅提及以下两种:
1)右键单击桌面上的计算机图标,选择属性,然后查看打开的窗口中的系统栏即可了解。
2)开始-所有程序-控制面板-系统和安全-查看计算机的名称
标题:C# Visual Studio IDE 002
链接:https://www.gbbxw.com/news/rj/20560.html
版权:文章转载自网络,如有侵权,请联系删除!
用户评论
C# with Visual Studio, it feels like I'm coding on a sleek canvas for my indie game development journey.
有16位网友表示赞同!
The synergy between C# and Visual Studio is unstoppable - my game logic flows beautifully.
有14位网友表示赞同!
Having C# support in Visual Studio makes debugging just as much fun as clicking through levels in my game!
有16位网友表示赞同!
The IDE's features with C# have significantly sped up my workflow, making coding for my games a breeze.
有13位网友表示赞同!
Visual Studio and its C# integration are like an upgrade to the gaming industry - more efficient and top-notch performance.
有13位网友表示赞同!
I'm so grateful for Visual Studio with the C# plugin because it's like having a personal AI programmer assistant!
有8位网友表示赞同!
The syntax highlighting in VS when coding games in C# is spot on, making my debugging sessions much more palatable.
有14位网友表示赞同!
Game development just got smoother thanks to C# through Visual Studio - perfect choice for indie game developers like me!
有14位网友表示赞同!
With C# in Visual Studio, I can finally visualize my game ideas as they come together line by line.
有12位网友表示赞同!
The project management tools and debugger interface of VS with C# are game changers; it streamlines my coding process significantly.
有6位网友表示赞同!
I'm amazed at how robust the C# integration is within Visual Studio - it's like having a full-fledged game studio in my hands!
有8位网友表示赞同!
From gameplay mechanics to AI scripting, I trust the C# toolset in Visual Studio for my project's success.
有5位网友表示赞同!
The seamless experience of combining creativity and coding with C# under Visual Studio makes me feel invincible while developing games.
有16位网友表示赞同!
No complaints about performance; Visual Studio IDE handles C# code like a champ when building immersive game experiences.
有15位网友表示赞同!
Thanks to the IDE features tailored for C#, my productivity spikes during those brainstorming sessions without an ounce of friction!
有12位网友表示赞同!
The integration of tools and resources in Visual Studio with C# provides me with a one-stop-shop solution for all my coding needs.
有17位网友表示赞同!
I've had a great experience with using Visual Studio for game development through C#. It feels like I'm building more with less effort.
有8位网友表示赞同!
Visualizing my game concepts into reality becomes an artistic process of code thanks to the elegant integration of C# and Visual Studio.
有5位网友表示赞同!
C# within Visual Studio IDE is like having a superpower - it empowers me with capabilities beyond just coding, enriching my games!
有19位网友表示赞同!