string clientIP = HttpContext.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (string.IsNullOrEmpty(clientIP))
clientIP = HttpContext.Request.ServerVariables["REMOTE_ADDR"];
if (string.IsNullOrEmpty(clientIP))
clientIP = HttpContext.Request.UserHostAddress;