Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I hope the question is clear..
Thanks.
Posted

1 solution

You don't say exactly what you're having difficulty with, so here is the whole process:

1) Make sure File.html is included in the build.
Set the "Build Action" property to "Embedded Resource".

2) Get the name of the resource
C#
string[] a = Assembly.GetEntryAssembly().GetManifestResourceNames();
foreach ( string s in a ) Debug.WriteLine( "\t" + s );


3) Extract the resource:
C#
string html = null;
using ( var s = Assembly.GetExecutingAssembly()
    .GetManifestResourceStream( "[name of resource.html]" ) )
using ( var r = new StreamReader( s ) )
    html = r.ReadToEnd();


4) Load in WebBrowser control:
C#
webBrowser1.DocumentText = html;


Nick
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900