构建后如何在C#的可执行文件中嵌入文件? [英] How to embend a file inside executable in C# after build?
问题描述
朋友们!
我找不到解决我问题的方法.在解释问题之前,我将解释我想做什么.
我有两个应用程序,一个为第二个创建加密的配置文件,该文件将在执行时读取该文件.
问题是:我想将配置文件隐藏到可执行文件中,该可执行文件在生成后将被读取.我不能只使用资源文件.
我在C/C ++中了解到它,并且知道可以做到,看到.但是在C#中如何?
我阅读了有关组装的内容,可以将其与ILMerge结合在一起.但是我丝毫不知道如何在应用程序执行期间创建程序集.
我需要这样做,以便对用户来说很简单.设置应用程序将配置文件嵌入另一个可执行文件中而不需要其他软件是一个好主意.
我该怎么办?
有什么办法可以像在C/C ++中一样吗?
或如何通过装配体来做到这一点?
如果有人想知道我想做什么...
我正在为游戏社区进行软件更新
.
Hi, friends!
I can not find a solution to my problem. Before explaining the problem I''ll explain what I want to do.
I have two applications, one that creates an encrypted configuration file for the second, that will read this file in its execution.
The problem is: I want to hide the configuration file into the executable that will read it after its build. I CAN''T just use resource files.
I read about it in C/C++ and I know I can do it, see it. But how in C#?
I read about assemblies to, I can embend it with ILMerge. But I do not have the slightest idea how I will create an assembly during the execution of an application.
I need to do this so that it be simple for the User. It would be a good idea to the setup application embed the configuration file in the another executable without needing additional software.
How can I do this?
Is there any way to do something like what is done in C/C++?
Or how to do this with Assemblies?
If someone is curious to know what I want to do...
I''m doing a software update for a gaming community
.
推荐答案
要动态创建代码,您需要研究CodeDOM; http://msdn.microsoft.com/en-us/library/y2k85ax6.aspx [ ^ ]
To create code on the fly you want to look into CodeDOM; http://msdn.microsoft.com/en-us/library/y2k85ax6.aspx[^]
这篇关于构建后如何在C#的可执行文件中嵌入文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!