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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Thavaselvan PalanivelRank #2,151 · 661 reputationPosted May 20, 2015, 10:30 PM EDT
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);
}
Suji D23 reputationPosted May 20, 2015, 10:49 PM EDT
Thavaselvan PalanivelRank #2,151 · 661 reputationPosted May 21, 2015, 1:48 AM EDT
Suji D23 reputationPosted May 21, 2015, 8:51 PM EDT
Thavaselvan PalanivelRank #2,151 · 661 reputationPosted May 21, 2015, 8:55 PM EDT