|
|
|
|
|
Dicas
|
|
Visual Basic (Validações)
|
|
|
Título da Dica: Validação de IP
|
|
|
|
Postada em 20/4/2004 por Marcos Nogueira
Public Function IsValidIPAddress(ByVal strIPAddress As String) As Boolean On Error GoTo Handler Dim varAddress As Variant Dim n As Long Dim lCount As Long varAddress = Split(strIPAddress, ".", , vbTextCompare) If IsArray(varAddress) Then For n = LBound(varAddress) To UBound(varAddress) lCount = lCount + 1 varAddress(n) = CByte(varAddress(n)) Next IsValidIPAddress = (lCount = 4) End If
Handler: End Function
|
|
|
|
|