Ken_Stenger
12-06-2004, 11:29 AM
Can anyone tell me how to open an HTML file from visual basic.net? I do not want to edit it or anything, I literally just want to open the html file named Main (Main.html) when my "Users Guide" button is clicked. Any suggestions will be much appreciated. Thank you
Ken
excaliber
12-06-2004, 12:51 PM
Well, do you wish to view it as text or as a web page?
If you want to view it as text, look at the System.IO namespace and use those classes (see this tutorial for some help: http://www.xtremevbtalk.com/showthread.php?t=148864)
If you wish to view it as a web page, you will need the IE Webbrowser control.
Ken_Stenger
12-06-2004, 01:43 PM
Well, do you wish to view it as text or as a web page?
If you want to view it as text, look at the System.IO namespace and use those classes (see this tutorial for some help: http://www.xtremevbtalk.com/showthread.php?t=148864)
If you wish to view it as a web page, you will need the IE Webbrowser control.
I want to view the file as a webpage. I literally just want to click a button and have Internet Explorer open with the html file as a webpage
excaliber
12-06-2004, 03:14 PM
Next question then. Do you want to open IE itself, or open IE within your program?
If just IE by itself, use System.Diagnostics.Process namespace.
Otherwise use the IE webbrowser.
Ken_Stenger
12-06-2004, 06:30 PM
First off - I would like to open the website separate from my program, I basically want to open the file with a new instance of IE completely separate from my program.
by using this forum I have obtained some code that works
System.Diagnostics.Process.Start("Iexplore", "http://www....Main.html")
where the "http://www......Main.html" is my personal website.
but the problem is, I would really like to link the file locally. I tried the following code:
System.Diagnostics.Process.Start("Iexplore", "Main.html")
and put Main.html in my bin file, but this gave me an error because when IE opened it opened with "http://Main.html" which caused a problem. Any Suggestions?
Ken
gravity7
12-06-2004, 06:35 PM
Try using a file path reference:
File://c:\myprogram\myhtmlfile.html as the URL and not the http://.....etc