Lim*_*ent 8 c# console redirectstandardoutput
我希望能够将我的程序从控制台中分离出来wget -b.代码片段可能看起来像
static void Main(string[] args)
{
var settings = new Settings(args);
if (settings.Background)
{
/*Tell the user what's going on.*/
System.Console.WriteLine("Detatching from console. The program will still be running.");
System.Console.Out.Close();
}
/*do work then exit.*/
}
Run Code Online (Sandbox Code Playgroud)
但是System.Console.Out.Close();没有做正确的事.
为了澄清,"正确的事情"是,当从控制台运行此程序时,应该重新出现提示.或者,从中运行此程序时explorer.exe,控制台窗口应该关闭.
如果我不清楚,请告诉我.
| 归档时间: |
|
| 查看次数: |
1196 次 |
| 最近记录: |