Function CheckStrIP(ByVal strIP)
' Valores de Entrada:	strIP
' Retorna:				True se for um endereo ip vlido
Dim i, n, intByte

	CheckStrIP = False
	
	If Len(strIP) > 15 Then Exit Function
	
	n = 0
	
	For i = 1 To 3
		n = InStr(strIP, ".")
		If n = 0 Then Exit Function
		intByte = Left(strIP, n - 1)
		strIP = Mid(strIP, n + 1)
		If Not IsNumeric(intByte) Then
			Exit Function
		End If
		If CDbl(intByte) <> CInt(intByte) Then Exit Function
		intByte = CInt(intByte)
		If intByte < 0 Or intByte > 255 Then Exit Function
	Next
	If InStr(strIP, ".") <> 0 Then Exit Function

	If Not IsNumeric(strIP) Then
		Exit Function
	End If
	intByte = CInt(strIP)
	If intByte < 0 Or intByte > 255 Then Exit Function
	
	CheckStrIP = True

End Function
