-
Does anybody know reliable way to get MAC address of Client PC using ASP.Net / C#
over 10 years ago
-
almost 9 years ago
private static string getMacAddress(string distIP) { IPAddress dIP = IPAddress.Parse(distIP); // the destination IP address byte[] macAddr = new byte[6]; uint macAddrLen = (uint)macAddr.Length; if (SendARP(BitConverter.ToInt32(dIP.GetAddressBytes(), 0), 0, macAddr, ref macAddrLen) != 0) throw new InvalidOperationException("SendARP failed."); string[] str = new string[(int)macAddrLen]; for (int i = 0; i < macAddrLen; i++) str[i] = macAddr[i].ToString("x2"); return string.Join("-", str); }
-
-
over 10 years ago
The code mentioned here will only work for the machine where it runs being the server side code.
We have tried to search for the MAC IP address in the request we get from the client but we did not get any success. We have also tried fetching it using javascript but it only works on IE browser which wont serve the purpose for MAC user.
Its still open from our side and will share the solution if we find any.
-
2 Answer(s)