hi all;
i require that after click on button of page the "lblCLMAC.T ext" should get populated the MAC address of that system on which the button of that page is pressed, not the MAC address of Server.
i require that after click on button of page the "lblCLMAC.T ext" should get populated the MAC address of that system on which the button of that page is pressed, not the MAC address of Server.
Code:
// This code i am doing on Button click event
Button_click()
{
ManagementClass mgmt = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection objCol = mgmt.GetInstances();
string CLMAC = String.Empty;
foreach (ManagementObject obj in objCol)
{
if (CLMAC == String.Empty)
{
if ((bool)obj["IPEnabled"] == true) CLMAC = obj["MacAddress"].ToString();
}
obj.Dispose();
}
lblCLMAC.Text = "Client MAC Address is :" + CLMAC;
}
}
Comment