C# Visual Studio 要回答的文本
C# Visual Studio's Text to Answer
这有点像菜鸟,我要问的是什么,但我正在尝试让我的程序运行我不知道如何在文本框中提问点击按钮,它会输出答案;我已经对此进行了一段时间的研究,我知道如何让其他一切正常工作。
一个简单的控制台应用示例:
static void Main()
{
bool exit = false;
string response;
while (!exit)
{
Console.Write("Command ('Exit' to end): ");
response = Console.ReadLine();
switch (response)
{
case "Hey":
Console.WriteLine("Welcome");
break;
case "unicorns":
Console.WriteLine("...are awesome!");
break;
case "Exit":
exit = true;
break;
default:
Console.WriteLine("Unrecognized command!");
break;
}
}
Console.Write("Press Enter to Quit");
Console.ReadLine();
}
这有点像菜鸟,我要问的是什么,但我正在尝试让我的程序运行我不知道如何在文本框中提问点击按钮,它会输出答案;我已经对此进行了一段时间的研究,我知道如何让其他一切正常工作。
一个简单的控制台应用示例:
static void Main()
{
bool exit = false;
string response;
while (!exit)
{
Console.Write("Command ('Exit' to end): ");
response = Console.ReadLine();
switch (response)
{
case "Hey":
Console.WriteLine("Welcome");
break;
case "unicorns":
Console.WriteLine("...are awesome!");
break;
case "Exit":
exit = true;
break;
default:
Console.WriteLine("Unrecognized command!");
break;
}
}
Console.Write("Press Enter to Quit");
Console.ReadLine();
}