Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

c# load embedded html document and show in browser

1. Add HTML Page from C3 Add New Item
2. Put html inside
3. Drag and drop the html (e.g. HTMLPage1.html) file into your Resources tab in the project:
4. Use code below 
        private void button1_Click_1(object sender, EventArgs e)
        {
            string html = Properties.Resources.HTMLPage1;
            string tmpFileName = Path.ChangeExtension(Path.GetTempFileName(), ".html");
            using (StreamWriter sw = File.CreateText(tmpFileName))
            {             
                sw.Write(html);
                sw.Flush();
            }
            if (File.Exists(tmpFileName))
                Process.Start(tmpFileName);
        }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #load #embedded #html #document #show #browser
ADD COMMENT
Topic
Name
7+8 =