是否可以检查 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/