System.Windows.Forms.WebBrowser.Navigate加载网络文件
我们正在使用网络浏览器显示位于网络文件夹中的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用 UNC 路径,如下所示:
Try using the UNC path, like this: