在C#中如何开始新的过程,而不是产卵过程的孩子? [英] In C# how to start new process, without being a child of the spawning process?

查看:115
本文介绍了在C#中如何开始新的过程,而不是产卵过程的孩子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

How to start a Start new process, without being a child of the spawning process 4 answers
I am using Process.start(). But in that case it is getting created as a child of the calling process.





我是什么尝试过:



我打电话给Process.Start(fullPathtoexe)



What I have tried:

I am calling as Process.Start(fullPathtoexe)

推荐答案

当您启动流程时,您就是父级。如果要删除该链接,则需要生成一个生成目标进程的中间进程,然后终止。因为中间过程是目标进程的父进程,所以当它关闭时,子连接被破坏。



这不难做到:只需写一个快速的无窗口接受作为启动过程的参数及其参数的应用程序。它使用Process.Start然后终止。



但是我不确定你为什么要这样做......
When you start a process, you are the parent. If you want to remove that link, you need to spawn an intermediate process that spawns your target process and then terminates. Because the intermediate process is the parent of the target process, when it closes the child linkage is broken.

That's not difficult to do: just write a quick no-window app that accepts parameters that are the process to start and its parameters. It uses Process.Start and then terminates.

But I'm not sure why you want to do this...


这篇关于在C#中如何开始新的过程,而不是产卵过程的孩子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆