In the button click event handler of a windows form, it looks at a file path c:\dev\Index.htm. I need to open this file in a browser window such as IE or chrome. How can I do this? Any example is very much appreciated.
Thank you!
In the button click event handler of a windows form, it looks at a file path c:\dev\Index.htm. I need to open this file in a browser window such as IE or chrome. How can I do this? Any example is very much appreciated.
Thank you!
I'm not sure if I understood your problem right. If you want to open an extern browser you can use:
System.Diagnostics.Process.Start("C:\\dev\\Index.htm");
if you want to show it in your Form, you have to use IE through a webBrowser. You can load your file via URI
yourBrowser.Url=new Uri("C:\\dev\\index.htm");
or you could load it through reading the Htm file manual and setting it as Document
yourBrowser.DocumentText=System.IO.File.ReadAllText("C:\\dev\\index.htm");
there are several other methods, I hope that I could help you.