gpt4 book ai didi

VB.NET如何检查网页是否存在

转载 作者:行者123 更新时间:2023-11-28 03:35:52 25 4
gpt4 key购买 nike

是否可以在 vb.net 应用程序中检查网页是否存在?

最佳答案

您可以通过请求有问题的网页并查看是否有错误消息来查明。

    Dim req As System.Net.WebRequest
Dim res As System.Net.WebResponse

req = System.Net.WebRequest.Create("http://www.google.com/werwerfsdfsdf")

Try
res = req.GetResponse()
Catch e As WebException
' URL doesn't exists
End Try

关于VB.NET如何检查网页是否存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14385798/

25 4 0
文章推荐: css - 我可以从我的打印 css 中删除 URL,这样网址就不会打印出来了吗?
文章推荐: web - 如何为网站创建 Facebook 测试用户?
文章推荐: html - 我的
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com