I want to know the IP address of the client machine, i.e. the IP address of the user who is browsing my website. I am trying the following code but it is returning server ad
string myIP = (HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] ?? HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]).Split(',')[0].Trim();
Note: For getting the public ip address this is used.