editing a text file in resource

2019-07-21 23:25发布

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?

1条回答
冷血范
2楼-- · 2019-07-21 23:33

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

查看更多
登录 后发表回答