Possible Duplicate:
How to embed a text file in a .NET assembly?
I have a c# winforms application that use several text files.
I would like to somehow embed those files either into the exe or dlls, so that they cannot be seen by the user when the application is deployed.
Can visual studio do something like that?
With text files you can also proceed as following:
Properties->Resources.resxfile to open the resource designer.Add Resource->Add Existing File...and select your text files.Let’s say that the TXT you added was called
Foo.txt… you can just access it’s content like so:Then you can also change te file names inside the resource designer and they will be automatically refactored in your code. From the
Resourcesdirectory, where they are now located in your project, you can also edit them.I just recommend you to keep their access level as
internal.