|
|
|
|
|
Dicas
|
|
Visual Basic (Internet)
|
|
|
Título da Dica: Verifica se uma URL e valida
|
|
|
|
Postada em 12/12/2003 por Andre
Private Declare Function IsValidURL Lib "URLMON.DLL" (ByVal pbc As Long, ByVal szURL As String, ByVal dwReserved As Long) As Long
Private Const S_FALSE = &H1 Private Const S_OK = &H0
Private Sub Form_Load() MsgBox "Is valid URL: " + CStr(IsGoodURL("http://www.vbweb.com.br")) MsgBox "Is valid URL: " + CStr(IsGoodURL("hxxp:/www.vbweb.uhoh")) End Sub
Public Function IsGoodURL(ByVal sURL As String) As Boolean sURL = StrConv(sURL, vbUnicode) 'Chama a funcao IsGoodURL = (IsValidURL(ByVal 0&, sURL, 0) = S_OK) End Function
|
|
|
|
|