.net (a) entry

 

 

.net / dotnet: .Net Framework frame generally refers to a technique internet.

C #: a programming language, you can develop applications based on .net platform

Java is a platform-even a programming language.

 

.Net Framework is an integral part of .Net platform, it provides a stable operating environment to ensure that we are able to work properly on a variety of applications .Net platform.

.Net platform as the kitchen, .Net Framework is a kitchen materials and tools.

 

What do .Net

  • Desktop application, called Winform application
  • Internet applications, ASP.NET
  • Mobile development, wp8
  • Unity3D game development or virtual reality

 

Development Tools: VS2017

New Project to create a console application

 

Open the project

 

The solution is to include the project, you can then create a solution in this project: Direct Right Solution, select Add, select New Project.

Program.cs, cs suffix to file a class file for the default content:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {

        }
    }
}

component:

Namespace references

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

Project or namespace name, enclose the class

Which contains classes, class Main function (method) is the entry program

namespace 项目名或命名空间
{
    class 类名
    {
        static void Main(string[] args)
        {

        }
    }
}

 

 

打开解决方案文件夹

 

 .sln:解决方案文件,里面包含着整个解决方案的信息,可以双击运行。

打开 HelloWorld文件夹

.csproj:项目文件,里面包含着这个项目的信息,可以双击运行。

 

写两行代码

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            Console.ReadKey();
        }
    }
}

F5运行程序

 Console.ReadKey() 的作用:暂停当前程序,等待用户按下任意键继续,按下的任意键将显示在控制台中。没有该句,程序运行一闪而过,控制台立刻关闭。

 

Guess you like

Origin www.cnblogs.com/aidata/p/12320678.html