|
-
March 2nd, 2003, 12:43 PM
#1
MAC Address when NOT connected to network
Hello,
Is there a way to read the MAC address when the computer is
not connected to the network?
All three ways in:
http://www.codeguru.com/network/GetMAC.html
Do not work when the computer is not connected to the network.
(You have to disconnect the computer and restart it).
-
March 2nd, 2003, 02:50 PM
#2
Interesting...GetAdaptorsInfo is suppose to work even if your not connected to the Network but the adaptors have to be enabled, as the comment in the link suggests. Never had the need to get a adapter status when the network isn't connected, but there is a fourth way using WMI...Win32_NetworkAdapterConfiguration
queryclass = L"select * from Win32_NetworkAdapterConfiguration";
querystring = L"MacAddress";
-
March 3rd, 2003, 12:47 PM
#3
penina,
I've used services of the iphlpapi.dll to get MACs while network
is unplugged. Basically, you get the address of the "GetIfTable"
function from the dll. Make an inital call to the function to get
the amount of memory you need to hold the result interface
table. Then call the function agian to get the actual interface
table data. Once you have the data, you iterate through the
table until you find an interface that resembles a network
adapter (see ipifcons.h MIB_IF_TYPE*). Then just grab the
physical address field from the data and your done.
regards, willchop
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|