![]() |
| ||
| Get MAC Address how can i get MAC Address in C#? |
| ||
| Re: Get MAC Address Use the Management Class object in .NET. ManagementClass oMClass = new ManagementClass ("Win32_NetworkAdapterConfiguration"); ManagementObjectCollection colMObj = oMCLass.GetInstances(); foreach(ManagementObject objMO in colMObj) { Console.WriteLine(objMO["MacAddress"].ToString()); } Makes sense? Andy |
| ||
| Re: Get MAC Address Quote:
Console.WriteLine(objMO["Caption"].ToString()); to your test before the mac address so that you know which devices you are looking at. Also, don't forget to use try/catch blocks on these as a NullPointerReference will kill the app. Andy |
| All times are GMT -4. The time now is 5:25 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC