文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
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

 

相关阅读 更多 +
排行榜 更多 +
托卡小镇古镇生活

托卡小镇古镇生活

休闲益智 下载
宝宝懂礼貌宝宝巴士游戏

宝宝懂礼貌宝宝巴士游戏

休闲益智 下载
托卡小镇迷你小屋

托卡小镇迷你小屋

休闲益智 下载