当前位置:网站首页>Take you to create your first C program (recommended Collection)
Take you to create your first C program (recommended Collection)
2022-07-25 15:27:00 【꧁ small ۣۖ Pigeon ۣۖ Puzi ۣۖ ิ꧂】
Knowing about console applications is usually knowing C# The first step in the application , It is a similar DOS The program of input and output in the interface of , It's learning C# The basic syntax of the program is the most convenient program .
Next, let's introduce how to create a console application .
Creating a console application is very simple , Choose in turn “ file ” One “ newly build ” One “ project ” command , The dialog box as shown in the following figure will pop up .
Choose among them “ Console Application ” Options , And set a name for the project 、 Location and solution name , single click “ determine ” Button to create a console application , The effect is shown below .
Note that the solution name is not necessarily the same as the project name , Multiple projects are allowed in the same solution .
As can be seen from the interface shown in the figure above, a new interface named Solution Solutions for , And in this solution, we created a project named Test Console application for .
stay Test The application contains a file called Program.cs Class files , The code in this file is shown in the figure below .
In this code, the 11 Go to the first place 13 Line is Main Method ,Main Method is a special method , And there can only be one in each class , Just write the code to Main In the method , After the project runs Main The code in the method will execute .
Apply on the console The method of outputting content in the console interface of the program is as follows .
Console.Write(); // Output content to the console interface without line break
Console.WriteLine(); // Line feed output content to the console interface
Now use the console application to output to the console “ first C# Program ” and “ This is a console application ”, The code for the implementation is as follows .
namespace test
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(" first C# Program ");
Console.WriteLine(" This is the first console program ");
}
}
}
Press Ctrl+F5 Key combinations run programs , The effect is shown below .

边栏推荐
- pageHelper不生效,sql没有自动加上limit
- matlab---错误使用 var 数据类型无效。第一个输入参数必须为单精度值或双精度值
- How to update JSON values in the database?
- 谷歌云盘如何关联Google Colab
- Hbck 修复问题
- Distributed principle - what is a distributed system
- matlab 优化工具 manopt 安装
- 分布式 | 实战:将业务从 MyCAT 平滑迁移到 dble
- See a lot of blinking pictures on apps, especially the member page
- 解决DBeaver SQL Client 连接phoenix查询超时
猜你喜欢

带你创建你的第一个C#程序(建议收藏)

ML - Speech - advanced speech model

Reflection - Notes

记一次Yarn Required executor memeory is above the max threshold(8192MB) of this cluster!

Spark partition operators partitionby, coalesce, repartition

ML - 自然语言处理 - 自然语言处理简介

NPM's nexus private server e401 E500 error handling record

从 join on 和 where 执行顺序认识T-sql查询执行顺序

ML - natural language processing - Key Technologies

《图书馆管理系统——“借书还书”模块》项目研发阶段性总结
随机推荐
Spark DF adds a column
理解“平均负载”
Spark 内存管理机制 新版
<栈模拟递归>
CF566A-贪心+字典树
How to update JSON values in the database?
HBCK fix problem
Spark submission parameters -- use of files
How much memory can a program use at most?
Submarine cable detector tss350 (I)
图论及概念
解决vender-base.66c6fc1c0b393478adf7.js:6 TypeError: Cannot read property ‘validate‘ of undefined问题
matlab--CVX优化工具包安装
Endnote 添加中文GBT7714样式 word中如何引用文献
Flex 布局
NPM's nexus private server e401 E500 error handling record
Overview of JS synchronous, asynchronous, macro task and micro task
ios 面试题
JVM-动态字节码技术详解
JVM知识脑图分享