asp.net获取IP地址
来源:互联网 发布:个性淘宝名字大全 编辑:程序博客网 时间:2024/05/16 07:17
//方法一HttpContext.Current.Request.UserHostAddress; //方法二HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];//方法三string strHostName = System.Net.Dns.GetHostName();string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();//方法四(无视代理)HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
//方法五var ip = '<!--#echo var="REMOTE_ADDR"-->';alert("Your IP address is "+ip);//方法六(无视代理)function GetLocalIPAddress() { var obj = null; var rslt = ""; try { obj = new ActiveXObject("rcbdyctl.Setting"); rslt = obj.GetIPAddress; obj = null; } catch(e) { // } return rslt; }
if(Context.Request.ServerVariables["HTTP_VIA"]!=null) // using proxy{ ip=Context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString(); // Return real client IP.}else// not using proxy or can't get the Client IP{ ip=Context.Request.ServerVariables["REMOTE_ADDR"].ToString(); //While it can't get the Client IP, it will return proxy IP.}
0 0
- ASP.NET获取IP地址
- asp.net获取IP地址
- asp.net获取 ip 地址
- asp.net获取IP地址
- asp.net获取IP地址mac地址
- asp.net获取URL和IP地址
- asp.net获取URL和IP地址
- asp.net获取URL和IP地址
- asp.net获取URL和IP地址
- asp.net获取URL和IP地址
- asp.net获取客户端IP地址方法
- asp.net获取URL和IP地址
- ASP.NET获取客户端IP地址
- asp.net获取URL和IP地址
- Asp.net【Js】获取Ip地址
- ASP.NET获取ip地址的方法
- asp.net 获取客户端ip地址
- asp.net获取URL和IP地址
- C#委托
- C#父窗体跟子窗体的控件操作
- C#Winfrom将浏览器生成Image
- 观察者模式
- session跟cookie的记住登陆名
- asp.net获取IP地址
- asp.net的页面传值方式
- asp.net中的<%%>用法
- C#发送邮件
- c#发邮件详解
- C#收邮件
- ubuntu12.04搭建git服务器
- 创建Wcf数据服务的事例
- C#发送手机短信