HttpContext.Current.Request.UserHostAddress
------------------------------------------------------------------------------------------------
通过代理,获取真实的ip
if(Context.Request.ServerVariables["HTTP_VIA"]!=null)
{
ip=Context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
}
else
{
ip=Context.Request.ServerVariables["REMOTE_ADDR"].ToString();
}

 

Posted on 2005-11-11 08:35  miqier  阅读(4394)  评论(2编辑  收藏  举报