操作方法:自动重新启动控制台应用程序。在.NET [英] How-To: Auto-Restart Console App. in .NET
本文介绍了操作方法:自动重新启动控制台应用程序。在.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何想法如何自动重新启动(重启)在.NET控制台应用程序?
any ideas of how to auto-restart (restart) Console application in .NET ?
我知道窗体应用程序是这样的:
I know that forms application have something like this:
Application.Restart();
,但这是不可能的控制台。
but this is not possible for Console.
另外,还要注意: 现在的问题是,我不能启动同一应用程序的两个实例:)
Also, NOTE: The problem is, that I can't start two instances of the same app :)
推荐答案
您可以为您的应用程序(见Process类)创建一个新的进程,启动它,之后立即关闭当前应用程序。
You could create a new process for your application (see the Process class), initiate it, and close your current application immediately after that.
这篇关于操作方法:自动重新启动控制台应用程序。在.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文