Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Gathering Machine Data
Message
De
23/06/2000 17:58:28
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00345312
Message ID:
00384106
Vues:
64
I think I posted this before but just in case anybody forgot <g> ...

The MS Winsock control only gives 1 IP#. If you have multiple adapters (say 2 NICs or 1 NIC and an internet connected Modem, etc.) then that control gives you just one of them. (there's no telling which one it will give you although it tends to give you the same one over and over) There are two reliable ways of getting the IP# of the adapter that you want that I'm aware of right now. One is to run the ipconfig command (at least in NT/W2K) and parse out what you want. The second is to look in the registry. All adapters and their IP#'s are stored there. Why can't MS just give us the option of selecting which adapter we want to use in the gethostbyname() (I think that's the Win32 function?) call ? I dunno.

Hope this helps somebody

- A Hilton



>The easiest way I know of is to use the MS Winsock control.
>
>ows = createobject("MSWinsock.Winsock")
>? ows.LocalIP
>
>This is for local IP addresses only.
>
>>How do you get the IP address of the local machine?
>>
A Hilton
Software & Technology Development,
Programming & Business Process Consulting
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform