Re: WebBrowser control opening local file
- From: Paul Clement <UseAdddressAtEndofMessage@xxxxxxxxxxxxxx>
- Date: Tue, 30 Jan 2007 08:52:25 -0600
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)
.
- References:
- WebBrowser control opening local file
- From: linuxnooby
- WebBrowser control opening local file
- Prev by Date: WebBrowser control opening local file
- Next by Date: Re: vb.net subclass help
- Previous by thread: WebBrowser control opening local file
- Index(es):
Relevant Pages
|