简体   繁体   English

如何修改和导出项目中包含的文件?

[英]How to modify and export files included in project?

For example, lets say I have a text file with one line of code named Template.txt included in the project folder. 例如,假设我有一个文本文件,项目文件夹中包含一行名为Template.txt的代码。

Since the text file is included with the project, is there another way to specify this file or would I still have to specify the full file path? 由于文本文件包含在项目中,是否有另一种方法可以指定该文件,还是我仍然需要指定完整的文件路径?

If it's included in the project and if you select the option copy always from the property Copy to Output Directory (Right click on the file and select properties in VS ), you will have the file available in the bin/ folder after compilation. 如果它包含在项目中,并且如果您copy always从属性Copy to Output Directory选择选项copy always (右键单击该文件,然后在VS选择属性),则编译后,该文件将位于bin/文件夹中。 So, you would not need the entire path. 因此,您将不需要整个路径。 Just the name of the file. 只是文件名。

在此处输入图片说明

如果我理解您的问题,则可以将该文件放在exe文件所在的文件夹中,并仅指定文件名[Template.txt]。

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

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