Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MAC Address
Message
From
04/08/1999 19:56:29
 
 
To
04/08/1999 17:23:17
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00249967
Message ID:
00250001
Views:
38
>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.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform