Results 1 to 3 of 3

Thread: [RESOLVED] Need help with navigating webbrowser to local file

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2013
    Posts
    200

    Resolved [RESOLVED] Need help with navigating webbrowser to local file

    Hello, I'm trying to navigate a webbrowser, here's my code:

    VB.NET Code:
    1. Dim so As New StringOperations
    2. Dim gPath = p.appPath & "\logo.html"
    3. gPath = "file:///" & gPath.Replace("\", "/")
    4. frm.WebBrowser1.Navigate(so.StringToUrl(gPath))

    Output is:
    Url after encoding: file:///C:/Users/Can/Desktop/oyun_listeleyici/Oyun%20Listeleyici/oyun_listeleyici/bin/Debug/logo.html

    I'm not getting any errors however the browser remains same. Can anyone help me?

    EDIT: I've been dealing with strings / uri's for hours I guess this isn't related to it.
    Last edited by nikel; Aug 7th, 2016 at 01:01 PM.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    23,238

    Re: Need help with navigating webbrowser to local file

    This worked for me for displaying local files:

    Code:
    WebBrowser1.Navigate(IO.Path.Combine(Application.StartupPath, "solution.htm"))

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2013
    Posts
    200

    Re: Need help with navigating webbrowser to local file

    Worked for me too. It's strange we have to hardcode for some things. Thanks a lot.

Tags for this Thread

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