简体   繁体   English

关闭C#中的调用程序后如何启动保持活动的外部应用程序?

[英]How to launch external application that keeps alive after closing the calling program in C#?

My target is to call an external program from my C# application and keep it alive even when my application is closing.我的目标是从我的 C# 应用程序中调用一个外部程序,并在我的应用程序关闭时使其保持活动状态。 Both applications don't share anything and I could accomplish the same task by running a command from the command line by passing in a few arguments.这两个应用程序不共享任何东西,我可以通过从命令行运行命令并传入几个 arguments 来完成相同的任务。

I've been trying to use the process class and I've been fiddling around with DTE, both let me create an instance of the external program (Visual Studio to be precise) but they will close as soon as the calling application is closing.我一直在尝试使用进程 class 并且一直在摆弄 DTE,两者都让我创建了外部程序的实例(准确地说是 Visual Studio),但它们会在调用应用程序关闭时立即关闭。

Is there any other way?还有其他方法吗? Maybe a call to Windows, that will launch that program instead of my application?也许调用 Windows,将启动该程序而不是我的应用程序?

Use Process.Start .使用Process.Start

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM