How to get MAC address of windows client.

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.
 
L

Lau Lei Cheong

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

ms-help://MS.VSCC.2003/MS.MSDNQTR.2005APR.1033/iphlp/iphlp/sendarp.htm
 
M

moondaddy

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?
 
P

Peter Huang [MSFT]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top