VB.NET:
Public Function IsValidWebPage(ByVal url As String) As Boolean
Dim blnOK As Boolean = IO.File.Exists(url)
If blnOK = False Then
If url.ToLower().StartsWith("www.") Then url = "http://" & url
Dim webResponse As System.Net.HttpWebResponse = Nothing
Try
Dim webRequest As System.Net.HttpWebRequest = CType(System.Net.HttpWebRequest.Create(url), System.Net.HttpWebRequest)
webResponse = CType(webRequest.GetResponse(), System.Net.HttpWebResponse)
If webResponse IsNot Nothing Then blnOK = True
Catch ex As Exception
blnOK = False
Finally
If Not (webResponse Is Nothing) Then webResponse.Close()
End Try
End If
Return blnOK
End Function
VB.NET:
Private Sub txtDocument_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtDocument.Validating
End Sub
Last edited by a moderator: