当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - Is there a way to configure a WinForms OpenFileDialog (or some other) to browse for website URL's instead of files?

问题描述:

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?

网友答案:

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

网友答案:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: