简体   繁体   English

如何在Visual Studio 2012中包含隐藏文件

[英]How to include hidden file with Visual Studio 2012

I have a file that I have included for a project, when compiled the file is created on the build directory. 我有一个项目包含的文件,编译后会在构建目录中创建该文件。 How to include the file directly in the .exe? 如何将文件直接包含在.exe中?

You'll want to look at working with Embedded Resources , which are files (content, either text or binary) that get embedded into the assembly during compilation: 您将要研究使用Embedded Resources ,它们是在编译过程中嵌入到程序集中的文件(内容,文本或二进制文件):

From MSDN: 从MSDN:

To change a resource from linked to embedded 将资源从链接更改为嵌入式

  1. With a project selected in Solution Explorer, on the Project menu, click Properties. 在解决方案资源管理器中选择一个项目后,在“项目”菜单上,单击“属性”。

  2. Click the Resources tab. 单击资源选项卡。

  3. On the Resource Designer toolbar, point to the resource view drop-down, click the arrow, and select the type of resource that you want to edit. 在“资源设计器”工具栏上,指向“资源视图”下拉菜单,单击箭头,然后选择要编辑的资源类型。

  4. Select the resource that you want to change. 选择您要更改的资源。

  5. In the Properties window, select the Persistence property and change it to Embedded in .resx. 在“属性”窗口中,选择“持久性”属性,然后将其更改为“嵌入在.resx中”。

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

相关问题 如何在Visual Studio 2012应用程序中包括.cat和.inf文件 - How to include .cat and .inf file in Visual studio 2012 application 文件在Visual Studio 2012中显示为隐藏 - Files show as hidden in Visual Studio 2012 如何在Visual Studio 2012中跨多个项目共享CSS文件? - How to share CSS file across multiple projects in Visual Studio 2012? Visual Studio 2012如何访问用户的文本文件资源? - Visual Studio 2012 how to access text-file resources for user? 如何在 Visual Studio 2012 中访问已发布的 .mdf 数据库文件 - How to access published .mdf database file in Visual Studio 2012 如何在Visual Studio Express 2012中将源代码添加到.dll文件? - How to add source code to .dll file in Visual Studio Express 2012? 怎么开 <visualStudioProject> Visual Studio 2012中的.sln TXT文件 - How to open <visualStudioProject>.sln TXT file in visual studio 2012 如何在Visual Studio Express 2012中添加resx文件? - How to add resx file in visual studio express 2012? 如何在Visual Studio 2012中的html页面的文件后面获取代码? - How to get code behind file for the html page in Visual Studio 2012? 如何在Visual Studio 2008和SQL Server 2012中创建.exe文件 - How to create .exe file in Visual Studio 2008 and SQL Server 2012
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM