So I'm debugging a C# program in Visual Studio, and it launches a command window for Process.Start
.
I want to keep this window open - however the method I tried - doing a Console.Readline();
didn't work.
Is there a standard way to keep a console window open so that I can see what happens when the program executes? It would be very helpful for debugging
您可以尝试使用CMD.EXE并将程序作为参数传递
Process.Start("cmd.exe", "/K \"dir\"");
由于您使用的是Visual Studio,因此不确定是否要使用Ctrl + F5键 ...这可以使控制台保持活动状态。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.