System.Windows.Forms.WebBrowser.Navigate加载网络文件

发布于 2024-12-01 22:25:33 字数 253 浏览 4 评论 0原文

我们正在使用网络浏览器显示位于网络文件夹中的 pdf 文件。代码如下所示:

System.Windows.Forms.WebBrowser.Navigate(New Uri("\\host\path\to\file.pdf"))

这工作正常,但现在我必须使用特定用户来访问此文件,并且我不知道如何在 URI 中包含用户名、密码和域。是否可以将用户凭据添加到 URI?我可以使用导航方法的另一种变体来完成此任务吗? 提前致谢。

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 include 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忆离笙 2024-12-08 22:25:33

尝试使用 UNC 路径,如下所示:

Dim networkPath As String = "\\server\path\to\file.pdf"

Try using the UNC path, like this:

Dim networkPath As String = "\\server\path\to\file.pdf"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文