C# Embedded Resource Copy to output directory I have files in my project which are set as embedded resources (pdf and htm files). I have also the value copy to output directory - copy if newer. This copies all files to a sub directory called resources (within Debug or Release) on compiling the project. However I want this to happen when just running the executable, any ideas?
And the provided links (that provided example code, no less) were unable to help?
Actually I just realised I need to embed these pdf / htm files properly as method above only works on compiling. Basically I want them to included in the exe (executable) file, but i am unsure how to do it.
I'm not entirely sure of the question. Are you asking about embedding resources, or saving resources as files?
Embedding resources. I've added the file (htm) as resource but unsure how to access it
And the provided links (that provided example code, no less) were unable to help?
I managed to use these embedded htm files using this code:
System.Reflection.Assembly thisExe;
thisExe = System.Reflection.Assembly.GetExecutingAssembly();
System.IO.Stream fileIn = thisExe.GetManifestResourceStream("InfoNet.Resources.LoadingHomePage.htm");
this.Browser.DocumentStream = fileIn;
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |