通过代理服务器获取真实ip by zhouwillpower
摘要:/// 取得客户端真实IP。如果有代理则取第一个非内网地址
///
public static string IPAddress
{
get
{
string result = String.Empty;
result = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if(result!=null&&result!= String.Empty)
{
//可能有代理
if(result.IndexOf(".")==-1) //没有“.”肯定是非IPv4格式
result = null;
else
{
阅读全文
posted @ 2006-07-08 17:06
浙公网安备 33010602011771号