Re: WebBrowser control opening local file

Tech-Archive recommends: Speed Up your PC by fixing your registry



On 29 Jan 2007 13:37:56 -0800, linuxnooby@xxxxxxxxxxxx wrote:

¤ Hi
¤
¤ I want a Web Browser Control to open a local file in Visual Basic
¤ 2005. It is a file "conditions.htm" that is in the same directory as
¤ the .net app. Is there a way of specifying a relative path rather than
¤ an absolute one? I have no control over where the application
¤ directory will be on the end user computer.
¤
¤ I have tried
¤
¤ WebBrowser1.Url = New Uri("conditions.htm")
¤ and
¤ WebBrowser1.Url = New Uri("file://conditions.htm")
¤
¤ But neither worked.
¤
¤ any suggestions?

The WebBrowser control doesn't understand relative paths.

Assuming the path is relative to your application you should just be able to use App.Path to create
the full path to the file, and then supply that value to the WebBrowser.


Paul
~~~~
Microsoft MVP (Visual Basic)
.



Relevant Pages

  • Re: Visual Basic 2008 express - Index property on label
    ... ¤> intended) differently and rather easily in Visual Basic.NET. ... "Control Arrays are arrays of controls sharing a common event handler. ...
    (microsoft.public.vb.general.discussion)
  • Re: Deploying VB.NET VB6 Interop User Controls in a dev environment
    ... ¤ Hi all. ... them in VB6 on my machine. ... I need the control to be ... I even attempted to rip all of the registry entries for the control from my ...
    (microsoft.public.vb.general.discussion)
  • Re: Images in an Access Database
    ... ¤ I found some code in this forum to do just this. ... the access report of the table for this entry. ... You can store data in the OLE field in a couple of different ways. ... The control you are using in the Access report is probably an OLE based control and ...
    (microsoft.public.vb.database.ado)
  • Re: Behaviour between ADO on ODBC Access Driver and Jet OLE DB
    ... Cursor type used is adOpenKeySet i.e. 1 ... ¤ Hi ... ¤ datagrid. ... I set the properties of the data control to open my database, ...
    (microsoft.public.vb.database.ado)
  • Re: Another Vista Problem(Index.dat)
    ... ¤> ¤ Yes, I think software should have free reign. ... ¤> So disable the security. ... looking for excuses to talk myself into Vista. ... I'd much rather control the whole system so ...
    (microsoft.public.vb.general.discussion)