文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>c#获得客户端IP地址

c#获得客户端IP地址

时间:2011-01-04  来源:非凡·SmallWhite

代码
#region  GetIp   获得IP地址
public static string GetIp()
{
if (System.Web.HttpContext.Current.Request.ServerVariables["HTTP_VIA"] != null)
{
return System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].
Split(
new char[] { ',' })[0];
}
else
{
return System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
}
}
#endregion

 

相关阅读 更多 +
排行榜 更多 +
你好买房吗

你好买房吗

模拟经营 下载
你好买房吗免广告

你好买房吗免广告

模拟经营 下载
梦幻魔法屋无限体力版

梦幻魔法屋无限体力版

模拟经营 下载