嵌入的* .exe成DLL [英] Embedded a *.exe into a dll

查看:142
本文介绍了嵌入的* .exe成DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人知道如何可以使嵌入exe文件到一个dll?

does somebody know how can I embedd an exe file into a dll ?

我有一个工具,它是我从C#代码中调用一个exe文件。

I have a tool which is an exe file that I call from c# code.

的事情是,我想有一个包含这个工具(exe文件)和DLL containg我的C#代码1 DLL。

The thing is that I want to have 1 dll containing this tool (exe file) and the dll containg my c# code.

是否有可能使嵌入的资源范围内,这个exe文件?

Is it possible to embedd this exe file within the resources?

Thx提前

推荐答案

当然是的。您可以在应用程序资源添加任何文件作为RC_DATA。但我相信你需要先调用之前将其解压缩到硬盘!

Sure it is. You can add any file as RC_DATA in application as resource. But I believe you will need to extract it to disk first before calling it!

您正在使用IDE /语言?

Which IDE/Language you are using?

对不起!你这样做,你正在使用C#提及。

Sorry! you did mention that you are using C#.


  1. 的资源文件添加到您的应用程序(右IDE单击应用程序,并选择添加新项

  2. 在需要时通过调用代码类似使用工具栏中的资源编辑器添加现有文件

  3. 然后将解压后的exe:$ b。
    $ b System.IO.File.WriteAllBytes(@C:\MyEXE\,Resource1.MyEXE);

这篇关于嵌入的* .exe成DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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