开发者

System.Windows.Forms.WebBrowser.Navigate to load a network file

开发者 https://www.devze.com 2023-04-01 15:05 出处:网络
We are using a web browser to show a pdf file located in a folder on the network. The code looks like this:

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

精彩评论

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