I have a small code that does some recalculations using text data provided. I also have written a readme file with the description of features and 'how-to' instructions. The main idea is to make the program standalone that is only one .exe file.
I did some googling, but found only how to work with external files or create installers.
The question is how to include a text file into the compiled .exe file and how to open it with a button click.
So far I found how to embed a resource and read it as a stream using Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName)
.
Though, when I try read it through StreamReader
it returns System.ArgumentNullException
Stream streamS = Assembly.GetExecutingAssembly().GetManifestResourceStream(ProjectName.Properties.Resources.Readme);
StreamReader rdr = new StreamReader(streamS);
string text = rdr.ReadToEnd();