Loading an html file from hard drive
Hi all
Im having a problem loading a html file to a webbrowser in a program im writing. What it does if I press a button or menu item a form is loaded
and a html help file is loaded to the WebBrowser1. here is the code
Code:
Public Class frmWeb
Private Sub frmWeb_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim path As String
'Load help document
path = Application.UserAppDataPath + "\winanvis3.01help.html"
WebBrowser1.Navigate("file:///" + path)
End Sub
End Class
The web page loads but all I get is
This program cannot display the webpage.
By the way Im new to visual studio 2005 the programe was originally writen in vb6.
Help Ed
Re: Loading an html file from hard drive
That logic works for me so I can only conclude that the file you're specifying doesn't exist. Have you viewed the actual contents of 'path' and confirmed that the file does actually exist at that location?
Re: Loading an html file from hard drive
Thanks the file was not there as soon aas I placed it in the directory it works fine now
again thanks
Ed