c# 如何在按下某个键后显示下一个写入行



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

例如

WriteLine("Press any key to display invoice...");
ReadKey(); //this part
WriteLine("***************************");
WriteLine("***  Corporation ***");
WriteLine("Customer Invoice rn");
WriteLine("SHIP TO: ");

程序结束之前,您需要再ReadKey一次

Console.WriteLine("Press any key to display invoice...");
Console.ReadKey(); //this part
Console.WriteLine("***************************");
Console.WriteLine("***  Corporation ***");
Console.WriteLine("Customer Invoice rn");
Console.WriteLine("SHIP TO: ");
// if you dont do this, the program ends and you cant see the other lines
Console.ReadKey(); 

最新更新