Hello everyone,
i want to track mac address of my pc. so send me code of c# to get mac address of my pc
How to get client machine MAC address
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
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
Abhijit PatilRank #700 · 3.4K reputationPosted Jun 30, 2014, 5:45 AM EDT
shivam
hope the following code is help for you
public static string GetClientIPAddress(System.Web.HttpRequest httpRequest) { string OriginalIP = string.Empty; string RemoteIP = string.Empty; OriginalIP = httpRequest.ServerVariables["HTTP_X_FORWARDED_FOR"]; //original IP will be updated by Proxy/Load Balancer. RemoteIP = httpRequest.ServerVariables["REMOTE_ADDR"]; //Proxy/Load Balancer IP or original IP if no proxy was used if (OriginalIP != null && OriginalIP.Trim().Length > 0) { return OriginalIP + "(" + RemoteIP + ")"; //Lets return both the IPs. } return RemoteIP; }