Hi all,
how to find the mac id for windows Xp using C# code.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Thavaselvan PalanivelPosted May 21, 2015, 2:30 AM
StringBuilder theQueryBuilder = new StringBuilder();theQueryBuilder.Append("SELECT MACAddress FROM Win32_NetworkAdapter");
ObjectQuery theQuery = new ObjectQuery(theQueryBuilder.ToString());
ManagementObjectSearcher theSearcher = new ManagementObjectSearcher(theScope, theQuery);
ManagementObjectCollection theCollectionOfResults = theSearcher.Get();
foreach (ManagementObject theCurrentObject in theCollectionOfResults)
{
string macAdd = "MAC Address: " + theCurrentObject["MACAddress"].ToString();
MessageBox.Show(macAdd);
}
Thavaselvan PalanivelPosted May 22, 2015, 12:55 AM
Suji DPosted May 22, 2015, 12:51 AM
Thavaselvan PalanivelPosted May 21, 2015, 5:48 AM
Suji DPosted May 21, 2015, 2:49 AM