Jump to content

Recommended Posts

Posted (edited)

This is what I'd use:

#include <INet.au3>
Global sPublicIP
HttpSetProxy(0)
;
; get WAN IP of user
Do
    $sPublicIP = GetWANIP() ; get WAN IP
Until $sPublicIP <> -1
;
Func GetWANIP()
    $sPublicIP = _GetIP() ; check WAN IP
    If @error Then
        Local $iBtnID = MsgBox("262197","ERROR","CAN'T GET WAN IP" & @CRLF & "Possible cause: Blocked by Firewall, Sandbox or insufficient bandwidth.")
        If $iBtnID = 2 Then Exit ; Cancel pressed
        If $iBtnID = 4 Then Return ($sPublicIP) ; Retry pressed (goes back to calling loop and returns again)
    EndIf
    Return ($sPublicIP)
EndFunc   ;==>GetWANIP

Edit: forgot to add the include.

Edited by PartyPooper

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...