执行程序作为线程而不是作为一个过程作为一个、线程、而不是、过程

2023-09-04 23:20:09 作者:爱你时有风

有没有办法让这股作为我的程序相同的内存空间来执行其他程序,如记事本,作为一个线程?所以,如果我的程序结束,因此将记事本,让记事本将不会在任务管理器中显示出来,只是我的计划?

Is there a way to execute another program, such as notepad, as a thread so it shares the same memory space as my program? So if my program ends, so will notepad and so that notepad won't show up in task manager, just my program?

推荐答案

没有,肯定不会像记事本一个非托管的应用程序。

No, certainly not for a non-managed app like notepad.

有关托管的应用程序,但是,您可以加载使用该实用程序组件的System.Reflection 并开始执行主要的()办法(或者更确切地说入口点)。

For a managed app, however, you can load the assembly using the utilities in System.Reflection and begin execution of the Main() method (or, rather entrypoint).

不过,也有在 System.Process 类的一些功能,可以帮助你模仿你在找什么做的。

However, there are a few features in the System.Process class that can help you emulate what you are looking to do.