private string GetClientIP()
{
string result = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; //http_forwarded_for
if (null == result || result == String.Empty)
{
result = Request.ServerVariables["REMOTE_ADDR"];//remote_addr
}
if (null == result || result == String.Empty)
{
result = Request.UserHostAddress;
}
return result;
}
{
string result = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; //http_forwarded_for
if (null == result || result == String.Empty)
{
result = Request.ServerVariables["REMOTE_ADDR"];//remote_addr
}
if (null == result || result == String.Empty)
{
result = Request.UserHostAddress;
}
return result;
}