📜  c# 输入 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:06.131000             🧑  作者: Mango

代码示例3
// Type your username and press enter
Console.Write("Type your username: ");
// Create a string variable and get user input from the keyboard and store it in the variable
String name = Console.ReadLine();
// Print the value of the variable (userName), which will display the input value
Console.WriteLine(name);
// or try this              
// Type your username and press enter
Console.Write("Type your username: ");
//Prints the username
Console.WriteLine(Console.ReadLine());