Results 1 to 3 of 3

Thread: Loading an html file from hard drive

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    15

    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

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    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?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    15

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width