我运行的是c#应用程序,然后在某些时候,应用程序抛出一个错误,然后应用程序应该结束。它结束,但控制台窗口保持打开...程序结束后c#控制台不会关闭
我甚至检查windows task manager
,在applications
选项卡下,列出我的控制台,但是当我点击go to process
,没有该应用程序的进程。
这很奇怪...应用程序结束,进程结束,但控制台停留在?我怎样才能杀死那个控制台?
编辑:我的代码:
static class Program
{
static void Main()
{
try
{
//bunch of static methods from other static classes are being invoked
Setup.Driver.Close();//another static method
}
catch (Exception)
{
Setup.Driver.Close();
}
}
}
第二个编辑:注:Process.Getprocess()杀死(),Application.Exit(),Environment.Exit()不是为我工作,在Windows任务管理器中,没有任何过程可以杀死,只有控制台保持打开状态!
你能后的代码? – Prashant 2013-03-15 05:50:46
你使用线程? – 2013-03-15 05:51:38
@Prashant:在编辑中发布我的代码。 – ojek 2013-03-15 05:52:43