Archive for March 26th, 2008|Daily archive page
VB Net – MegaUpload URL Checker
Public Function MUURLCheck(ByVal URL As String) As Boolean
If My.Computer.Network.IsAvailable = False Then
MessageBox.Show(“There is currently no network connection available”, “Error:”, MessageBoxButtons.OK, MessageBoxIcon.Error)
Return False
Exit Function
End If
Dim check As Integer = InStr(URL.ToLower, “megaupload.com/?d=”)
If check = 0 Then
Return False
Exit Function
End If
If Not Mid(URL, 1, 7).ToLower = “http://” Then
URL = “http://” & URL
End If
Try
Dim rq As Net.HttpWebRequest = Net.HttpWebRequest.Create(URL)
Dim rs As Net.HttpWebResponse = rq.GetResponse()
Return True
Catch ex As Exception
Return False
End Try
End Function
Usage:
If MUURLCheck(“www.megaupload.com/?d=GY82RQ35″) = True Then
MsgBox(“URL exists”)
Else
MsgBox(“Incorrect URL”)
End If
Leave a Comment