i require MAC address of client not server.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • balach
    New Member
    • Sep 2008
    • 18

    i require MAC address of client not server.

    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.


    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;
    
    }
    }
  • PRR
    Recognized Expert Contributor
    • Dec 2007
    • 750

    #2
    To connect to a remote PC... for information you need to specify username .. password and ip

    check out this thread:
    Click

    ok you are the same guy... you should update your question on the same thread...
    As for your question as the aspx page runs on the server you will get the info of server .. in case you want the client info you should be equip with client info such as username, password and IP... WMI can be misused.. therefore its blocked by default...
    As far as gettin info through WMI is concerned thats the way to do it ... i would like to hear if there are more ways....

    Comment

    Working...