Windows Develop Bookmark and Share   
 index > Windows Forms General > WebBrowser: Display file from UNC path
 

WebBrowser: Display file from UNC path

Greetings,

I'm wondering if it's possible to show a file in a WebBrowser control that comes from a UNC path. For example, setting the .Url property to something like \\MyServer\MyFile.gif.

I'm getting an exception saying "Invalid URI: The format of the URI could not be determined."

I can get around it by mapping a drive, just wondering if this is something I'm doing wrong of if it just plain won't work with a UNC path.

Thanks,

Mike

Mike Hildner  Monday, May 05, 2008 2:32 PM

Use the "file://" format.

Code Snippet

webBrowser1.Navigate(@file://MyServer/MyFile.gif);

David M Morton  Monday, May 05, 2008 5:11 PM

Use the "file://" format.

Code Snippet

webBrowser1.Navigate(@file://MyServer/MyFile.gif);

David M Morton  Monday, May 05, 2008 5:11 PM

Ah, thanks David. Works fine.

Mike Hildner  Monday, May 05, 2008 5:34 PM

You can use google to search for other answers

Custom Search

More Threads

• Thread analysing using ListBox versus Console, question.
• Vista won't allow program to run
• Unable to find the requested .Net Framework Data Provider
• Showing a Form that lies in bakground
• Design view
• WebBrowser control in service
• URGENT:Resolution Problem
• How can i create a setup
• Context menu on a datagridview
• Speeding up background image