Private Sub Command1_Click()
user = Text1 'tu mail
pass = Text2 'tu pass
host = Text3 'tu hostname
ip = "" 'dejalo vacio para autodetectar
Text4.Text = UpdateNoIP(user, pass, host, ip)
End Sub
'modificado por Tengu ..::Fireb0y::..
Function UpdateNoIP(UserName, Password, Hostname, actIP)
Dim xmlhttp As Object
Dim URL As String
Set xmlhttp = CreateObject("microsoft.xmlhttp")
URL = "http://dynupdate.no-ip.com/dns?username=" & UserName
URL = URL & "&password=" & Password & "&hostname=" & Hostname
If actIP <> "" Then URL = URL & "&ip=" & actIP
'Clipboard.Clear
'Clipboard.SetText URL
xmlhttp.open "get", URL, False
xmlhttp.SetRequestHeader "Pragma", "no-cache"
xmlhttp.SetRequestHeader "Cache-control", "no-cache"
On Error Resume Next
xmlhttp.Send
If Err.Number <> 0 Then
UpdateNoIP = "Error!"
Exit Function
End If
If xmlhttp.Status = 200 Then
UpdateNoIP = CStr(xmlhttp.responseText)
Else
If xmlhttp.Status = 401 Then
UpdateNoIP = "Authorization Error"
Else
UpdateNoIP = "Error"
End If
End If
If InStr(UpdateNoIP, ":") Then
Status = AfterLast(UpdateNoIP, ":")
Status = BeforeLast(Status, Chr(10))
Select Case Status
Case 0: UpdateNoIP = "Success - IP address is current, no update performed"
Case 1: UpdateNoIP = "Success - DNS hostname update successful"
Case 2: UpdateNoIP = "Error - Hostname supplied does not exist"
Case 3: UpdateNoIP = "Error - Invalid username"
Case 4: UpdateNoIP = "Error - Invalid password"
Case 5: UpdateNoIP = "Error - Too many updates sent. Updates are blocked until 1 hour passes since last status of 5 returned."
Case 6: UpdateNoIP = "Error - Account disabled due to violation of No-IP terms of service. Our terms of service can be viewed at http://www.no-ip.com/legal/tos"
Case 7: UpdateNoIP = "Error - Invalid IP. Invalid IP submitted is improperly formated, is a private LAN RFC 1918 address, or an abuse blacklisted address."
Case 8: UpdateNoIP = "Error - Disabled / Locked hostname"
Case 9: UpdateNoIP = "Host updated is configured as a web redirect and no update was performed."
Case 10: UpdateNoIP = "Error - Group supplied does not exist"
Case 11: UpdateNoIP = "Success - DNS group update is successful"
Case 12: UpdateNoIP = "Success - DNS group is current, no update performed."
Case 13: UpdateNoIP = "Error - Update client support not available for supplied hostname or group"
Case 14: UpdateNoIP = "Error - Hostname supplied does not have offline settings configured. Returned if sending offline=YES on a host that does not have any offline actions configured."
Case 99: UpdateNoIP = "Error - Client disabled. Client should exit and not perform any more updates without user intervention."
Case 100: UpdateNoIP = "Error - User input error usually returned if missing required request parameters"
End Select
End If
End Function
'modificado por Tengu ..::Fireb0y::..
Function AfterLast(sFrom, sAfterLast)
If InStr(1, sFrom, sAfterLast) Then
AfterLast = Right(sFrom, Len(sFrom) - InStrRev(sFrom, sAfterLast) - (Len(sAfterLast) - 1))
Else
AfterLast = ""
End If
End Function
Function BeforeLast(sIn, sLast)
t = AfterLast(sIn, sLast)
l = Len(sIn) - Len(t) - Len(sLast)
BeforeLast = Left(sIn, l)
End Function