简体   繁体   English

exe中的Visual Studio 2010包含文件

[英]Visual Studio 2010 include files in the exe

i have a simple question: I am using Visual Studio 2010 (I need this version for a special framework that does not work with a newer version) and i'd like to generate a standalone-exe without any extra files. 我有一个简单的问题:我正在使用Visual Studio 2010(我需要此版本用于不兼容较新版本的特殊框架),并且我想生成一个没有任何额外文件的独立文件。

The project itself includes some small images as PNG-files and a few other files. 该项目本身包括一些小图像,如PNG文件和其他一些文件。

When i compile the program, there is a content-directory with all my files inside. 当我编译程序时,有一个目录目录,其中包含我所有的文件。 I tried to search the options for any options but i was not successful 我试图在选项中搜索任何选项,但未成功

Add your files as an embedded resource and you will have them inside the exe. 将文件添加为嵌入式资源,然后将它们放入exe。

Right click on the file in the Solution Explorer -> Properties -> Build Action -> Embedded Resource. 在解决方案资源管理器->属性->构建操作->嵌入式资源中右键单击文件。

Also you can check this MSDN article: http://support.microsoft.com/kb/319292 您也可以查看此MSDN文章: http : //support.microsoft.com/kb/319292

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM