How to get the MAC address?

A

Allan Michaels

Hello,

I need to get the MAC address of our network card using a C# call from our
software.

How should I proceed?

Thank you in advance for your help.
 
S

Steven Cheng

Hi Allan,

As Mark has suggested, you can use .NET code(C#) to query MAC address
through the WMI programing interface. Here is another article mentioned
this:

http://cshark.wordpress.com/2009/05/28/how-to-get-mac-address-of-a-system-in
-c/

Also, there are many reference on directly using WIN32 api to get the
network information(include MAC):

#How To Get the MAC Address for an Ethernet Adapter
http://support.microsoft.com/kb/118623

#Extracting MAC Addresses Programmatically
http://www.osix.net/modules/article/?id=433

For .net, you can also use interop to call win32 api or unmanaged
functions(from an unmanaged dll).

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

--------------------
 
S

Steven Cheng

Hi Allan,

Have you got any progress on this issue?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
 

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