I am programming .NET (C #) using Visual Studio. I want to use XML file to store some information in my program. No other programs will ever need to access this XML file and it will need to manually access / modify without using any programs. I am thinking of which build option should I choose for this file, or if it really makes a difference? Is it an embedded resource or content file, etc? If I can make it into the correct .exe, but I do not think it is possible. Also, if I have to do something special to reference the file, please comment on it.
Add your file to the project as a resource
of this method By using, the resource is added to your assembly and it comes in the form of a firmly typed property of the resource class (BaseNamespace.Properties.Resources). It is very easy to use in comparison to the old school GetManifestResourceStream version, plus you compile time security.
Comments
Post a Comment