有没有办法配置 WinForms OpenFileDialog(或其他)来浏览网站 URL 而不是文件?

发布于 2024-09-29 18:47:28 字数 64 浏览 0 评论 0原文

这个问题说明了一切。

有没有一种方法可以浏览网站链接,以便在选择后从对话框中返回 URL 字符串?

The question says it all.

Is there a way to browse for website links such that, upon selection, it'll return the URL string from the dialog?

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

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

发布评论

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

评论(2

樱花落人离去 2024-10-06 18:47:28

您不会浏览网站链接,因为网站链接的数量几乎是无限的(您的应用程序如何知道它们是什么?)。相反,您只需创建一个带有文本框的自定义表单并清理输入(将其传递到 Uri 构造函数将为您解析它)。

You do not browse for website links since there is an almost infinite number (and how does your application know what they are?). Instead, you can just create a custom form with a textbox on it and sanitize the input (pass it to the Uri constructor which will parse it for you).

仄言 2024-10-06 18:47:28

只要 ValidateNames 属性为 false,您就应该能够从 FileName 属性中提取 URL。您仍然需要自行处理获取 URL 中指定的文件。

As long as the ValidateNames property is false, you should be able to pull a URL out of the FileName property. You'll still have to deal with fetching the file specified in the URL on your own.

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