编辑资源文本文件 [英] editing a text file in resource

查看:150
本文介绍了编辑资源文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C#项目增加了一个文本文件资源文件。在我看到这个文件的字符串,如应用程序:恩

 字符串fileContent = Properties.Resources.fileName; 



我的问题是我怎么可以编辑文本文件,并使用代码保存它放回资源文件?


解决方案

您也许不应该试图取消烤苹果派。



节目资源并不意味着是一个可写的数据库。您应该加载和保存在Environment.SpecialFolders.etc位置信息。



如果你必须试试这个,回答这个问题,可能会做你想要什么:修改正在运行的可执行

I added a text file to a resource file in my c# project. In the application I see this file string like : 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.

If you "must" try this, an answer to this question might do what you want: Modifying resource contents of a running executable

这篇关于编辑资源文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆