我如何调用一个exe文件是在.NET程序集嵌入的资源? [英] How do I invoke an exe that is an embedded resource in a .Net assembly?

查看:138
本文介绍了我如何调用一个exe文件是在.NET程序集嵌入的资源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我包含在我的.NET程序集作为嵌入资源一个non-.Net可执行文件。有没有一种方法来运行这个可执行文件,不涉及其写入到磁盘,并启动它?

I have a non-.Net executable file that is included in my .net assembly as an embedded resource. Is there a way to run this executable that does not involve writing it out to disk and launching it?

这是NET 2.0。

推荐答案

您可以加载一个字节数组使用的的Assembly.Load

You can load a .NET assembly from a byte array using an overload of Assembly.Load.

然而,存在对于安全性模型的影响需要考虑这使事情更加复杂。见讨论这里,也是这个<一个href="http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.framework.clr/2006-08/msg00069.html"相对=nofollow>发。

However, there are implications for the security model that need to be considered which make things more complex. See the discussion here, and also this thread.

如果您的嵌入式可执行文件也不是.NET那么我认为你必须先写入到磁盘上。

If your embedded executable is not .NET then I think you will have to write it out to disk first.

这篇关于我如何调用一个exe文件是在.NET程序集嵌入的资源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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