Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get computer IP address w/o using MSWinsock
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
01273978
Message ID:
01273995
Vues:
23
Works like a champ!

Thanks!

>
DECLARE INTEGER GetIpAddrTable IN iphlpapi;
>    STRING  @ pIpAddrTable,;
>    INTEGER @ pdwSize,;
>    INTEGER   bOrder
>DECLARE STRING inet_ntoa IN ws2_32 INTEGER in_addr
>
>pdwSize =0
>=GetIpAddrTable (NULL, @pdwSize, 1)
>
>pIpAddrTable = REPLICATE(CHR(0), pdwSize)
>=GetIpAddrTable (@pIpAddrTable, @pdwSize, 1)
>
>nombre = buf2dword(SUBSTR(pIpAddrTable, 1, 4))
>
>FOR i=1 TO nombre
>  Adresse = INET_NTOA(buf2dword(SUBSTR(pIpAddrTable, 5 + (i-1)*24, 4)))
>  Masque  = INET_NTOA(buf2dword(SUBSTR(pIpAddrTable, 13 + (i-1)*24, 4)))
>  ? adresse + "/" + masque
>Next
>
>FUNCTION buf2dword(cBuffer)
>RETURN Asc(SUBSTR(cBuffer, 1,1)) + ;
>    Asc(SUBSTR(cBuffer, 2,1)) * 256 +;
>    Asc(SUBSTR(cBuffer, 3,1)) * 65536 +;
>    Asc(SUBSTR(cBuffer, 4,1)) * 16777216
>
>
>>One of the miserable systems I'm working with here runs on a Citrix web farm.
>>
>>One item I'd like to be able to access in the application error handler is the IP address of the machine the application is running on.
>>
>>Normally I'd do that through MSwinsock.
>>
>>Naturally, that is failing when running on the Citrix boxes (##$@#). I do not have administrative access to the Citrix farm so it is very difficult to try to debug.
>>
>>Is there some reasonably easy way to pull the current IP address without using Winsock?
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform