是否可以检查VB.net中是否存在网页

时间:2018-05-20 07:52:04

标签: vb.net

Is it可以检查网页是否存在。我不知道该怎么做

1 个答案:

答案 0 :(得分:-1)

检查是否可以将其下载到字符串: -

Public Function MyFunc(URL As String) As String
    Dim sourceString As String = String.Empty
    Try
        sourceString = New Net.WebClient().DownloadString(URL)
    Catch ex As Exception

    End Try
    Return sourceString
End Function
'================================================
msgbox(MyFunc("http://etc ...")