Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends,

I want to get client side MACID. But i got server side MACID when had using the below code.

protected void Page_Load(object sender, EventArgs e)
   {
       ManagementObjectSearcher objQuery = null;
       ManagementObjectCollection queryCollection = null;

       try
       {
           objQuery = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration");

           queryCollection = objQuery.Get();

           foreach (ManagementObject mgmtObject in queryCollection)
           {
               if (mgmtObject["MacAddress"] != null)
               {
                   Response.Write(mgmtObject["MacAddress"].ToString());
               }
           }
       }
       catch (Exception ex)
       {
           Response.Write(ex.Source);
           Response.Write(ex.Message);
       }
   }




NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
        String sMacAddress = string.Empty;
        foreach (NetworkInterface adapter in nics)
        {
            if (sMacAddress == String.Empty)// only return MAC Address from first card  
            {
                IPInterfaceProperties properties = adapter.GetIPProperties();
                sMacAddress = adapter.GetPhysicalAddress().ToString();
                Response.Write(sMacAddress);
            }
        }


Please give me the sample coding.

Regards,
Mahalakshmi S
Posted

1 solution

In your code you have not specified the remote server link .
you have to specify that one

try this

http://stackoverflow.com/questions/6691565/how-get-client-user-machine-name-computer-name-with-jquery-or-javascript-or[^]
 
Share this answer
 
Comments
lakshmi.ksangam 23-Jan-12 8:16am    
i want to get client system MACId. the above link is not help me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900