Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MAC Address
Message
De
04/08/1999 20:33:10
Timothy Enright
Coos Bay Public Schools
Coos Bay, Oregon, États-Unis
 
 
À
04/08/1999 19:56:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00249967
Message ID:
00250015
Vues:
39
>>Can you obtain the ethernet address using native VFP code? I found an article on how to do it in C and noticed that it uses structures. Has anyone done this?
>>
>
>The easiest ways are to either use the WinSock Active control to retrieve the MAC address through ActiveX automation, or to dump the output of IPCONFIG /ALL to a file and parse the results on a line-by-line basis (you can issue a command line switch to dump the output to a standard file; IPCONFIG /HELP will provide the basic details.)
>
>Realize that not all systems have real MAC addresses, and you may have more than one MAC address on systems with more than one LAN adapter.
>
>You can access Win32 API calls through VFP using structures built in static memory blocks; you can look at my CLSHEAP library, Paul-Vlad Tatavu's POINTERS class, and especially Christof Lange's STRUCT class to see several approaches to implementing structures beyond the simple declarations available directly through VFP's DECLARE...DLL syntax.

Ed,

The MAC address is available from IPCONFIG (NT) and WINIPCFG (95-98) and can easily be dumped to a file (although messy). I was unable to get Winsock to deliver the MAC address to me but it does have the IP address. I got your message while I was reading Christof's doc's and might play with that some (although it is beyond my current understanding).

Since this question has been posted several times and the C code is provided in the Q118623 article - I figured it would be a snap for you <grin>...

...tim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform