How to get MAC address of windows client.

  • Thread starter Thread starter moondaddy
  • Start date Start date
M

moondaddy

I'm writing a vb.net 1.1 winforms app and want to get the MAC address of the
client. how do i do that?

Thanks.
 
You can use SendARP() API from "iphlpapi.dll" to get it.

ms-help://MS.VSCC.2003/MS.MSDNQTR.2005APR.1033/iphlp/iphlp/sendarp.htm
 
Thanks that worked really good. Question:

I tried to step through the sample code from the URL you gave and as soon as
the execution entered the For Each loop, it would hang a very long time and
ultimately I had to ctl+alt+del to stop the sample app. Does this use a lot
of resource to use or is it just conflicting APIs while I'm stepping through
it?
 
Hi

The management class is a managed wrap for WMI. It use the WMI interface to
do the query similar as query a database.
So it will not conflict with the API.
In the foreach loop, if you step through, debugger will try to retrieve
many information, about all the visiable var in the current context which
may take a long time.
Also I think the debugger may try to load the symbol may take a few time.

I think the API approach is also an alternative.
If you still have any concern, please feel free to post here.


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top