执行程序作为线程而不是作为一个过程 [英] Executing a program as a thread and not as a process

查看:108
本文介绍了执行程序作为线程而不是作为一个过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

这篇关于执行程序作为线程而不是作为一个过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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