开发者

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"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜