控制台的使用

1、

Console.WriteLine("hello world ");//自动换行

2、

Console.Write("hello world ");//不换行

3、

Console.ReadKey(); //等待键入

4、格式输出

int myInteger;  

string myString;  

myInteger = 17;  

myString = ""myInteger"is";  

Console.WriteLine("{0} {1}.", myString, myInteger);  

6、输入

string userName;  

Console.WriteLine("Enter your name");  

userName = Console.ReadLine(); 

原文地址:https://www.cnblogs.com/judes/p/9042080.html