0

基本上在我的代码中,我希望它在用户按下一个键后显示下一行。我以为它是ReadKey,但在我按下一个键后它就关闭了。

例如

WriteLine("Press any key to display invoice...");
ReadKey(); //this part

WriteLine("***************************");
WriteLine("***  Corporation ***");
WriteLine("Customer Invoice \r\n");
WriteLine("SHIP TO: ");
4

1 回答 1

2

ReadKey在程序结束之前你需要另一个

Console.WriteLine("Press any key to display invoice...");
Console.ReadKey(); //this part

Console.WriteLine("***************************");
Console.WriteLine("***  Corporation ***");
Console.WriteLine("Customer Invoice \r\n");
Console.WriteLine("SHIP TO: ");

// if you dont do this, the program ends and you cant see the other lines
Console.ReadKey(); 
于 2019-01-17T05:17:38.103 回答