Is there a URL validator on .Net?

后端 未结 5 581
失恋的感觉
失恋的感觉 2020-12-28 12:37

Is there a method to validate URLs in .Net, ASP.Net, or ASP.Net MVC?

5条回答
  •  臣服心动
    2020-12-28 13:02

    A faster way (probably) than using try/catch functionality would be to use Regex. If you had to validate 1000s of URLs catching the exception multiple times would be slow.

    Here's a link to sample Regex- use Google to find more.

提交回复
热议问题