文章详情

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

 

相关阅读 更多 +
排行榜 更多 +
探聊交友

探聊交友

聊天通讯 下载
天骄通

天骄通

旅游住宿 下载
奥的斯

奥的斯

商务办公 下载