System.Windows.Forms.WebBrowser.Navigate to load a network file
We are using a web browser to show a pdf file located in a folder on the network. The code looks like this:
System.Windows.Forms.WebBrowser.Navigate(New Uri("\\host\path\to\file.pdf"))
This works fine, but now I have to use a specific user to access this file and I don't know how to in开发者_运维百科clude the user name, password and domain in the URI. Is it posible to add user credentials to the URI? Can I use another variant of Navigate method to accomplish this? Thanks in advance.
Try using the UNC path, like this:
Dim networkPath As String = "\\server\path\to\file.pdf"
精彩评论