Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
控制台窗口在使用 c# 的 Visual Studio 中不稳定。ReadLine()也不工作。窗口立即消失,我看不到结果。
ReadLine()
您需要在代码后添加以下行:
Console.ReadKey();
这将阻止控制台执行下一行,直到您按任意键。在您的情况下,它将简单地完成运行代码。