it's not that great to let people get their local ip that way.. let the program get it!
LOAD DLL "iphlpapi.dll", 1
LOAD DLL "wininet.dll", 2
pSize AS DWORD
pHostName AS DWORD
pLocalIP AS DWORD
pWebIP AS DWORD
pSize = MAKE MEMORY(4)
FILL MEMORY pSize, 0, 4
CALL DLL 1, "GetIpAddrTable", 0, pSize, 0
pLocalIP = MAKE MEMORY(*pSize)
CALL DLL 1, "GetIpAddrTable", pLocalIP, pSize, 0
IP AS BYTE
pIP = pLocalIP + 4
FOR I = 1 to 4
IP = *pIP
LocalIP$ = LocalIP$ + STR$(IP)
IF I < 4 THEN LocalIP$ = LocalIP$ + "."
INC pIP
NEXT I
DELETE MEMORY pLocalIP
pWebIP = make memory(256)
CALL DLL 2, "InternetAttemptConnect", 0
Connect = CALL DLL(2, "InternetCheckConnectionA", "http://checkip.dyndns.org/", 1)
IF Connect = 0 THEN PRINT "No Internet Connection!"
hInt = CALL DLL(2, "InternetOpenA", "checkip", 0, "", "", 0)
hUrl = CALL DLL(2, "InternetOpenUrlA", hInt, "http://checkip.dyndns.org/", "", 0, 0, 0)
CALL DLL 2, "InternetReadFile", hURL, pWebIP, 256, pSize
WebIP$ = GetString(pWebIP + 76)
WebIP$ = LEFT$(WebIP$, LEN(WebIP$) - 16)
CALL DLL 2, "InternetCloseHandle", hUrl
CALL DLL 2, "InternetCloseHandle", hInt
DELETE MEMORY pWebIP
DELETE MEMORY pSize
delete dll 1
delete dll 2
LocalIP$ = local ip
WebIP$ = external ip
we'll all turn mad someday..