简体   繁体   English

在资源中编辑文本文件

[英]editing a text file in resource

I added a text file to a resource file in my c# project. 我在我的C#项目的resource文件中添加了一个text file In the application I see this file string like : ex. 在应用程序中,我看到此文件字符串,如:ex。

    string fileContent = Properties.Resources.fileName;

My question is how can I edit the text file and save it back into the resource file using code? 我的问题是如何编辑文本文件并使用代码将其保存回资源文件中?

You probably shouldn't be trying to un-bake an apple pie. 您可能不应该尝试去烤苹果派。

The program resources were NOT meant to be a writable database. 程序资源并非旨在成为可写数据库。 You should be loading and saving this information in the Environment.SpecialFolders.etc location. 您应该在Environment.SpecialFolders.etc位置中加载并保存此信息。

If you "must" try this, an answer to this question might do what you want: Modifying resource contents of a running executable 如果您“必须”尝试此操作,则此问题的答案可能会满足您的要求: 修改正在运行的可执行文件的资源内容

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

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