【转】C#如何获取客户端/服务端IP地址
2011-07-11 16:02
435 查看
客户端ip:
Request.ServerVariables.Get("Remote_Addr").ToString();
客户端主机名:
Request.ServerVariables.Get("Remote_Host").ToString();
客户端浏览器IE:
Request.Browser.Browser;
客户端浏览器 版本号:
Request.Browser.MajorVersion;//
客户端操作系统:
Request.Browser.Platform;
服务器ip:
Request.ServerVariables.Get("Local_Addr").ToString();
服务器名:
Request.ServerVariables.Get("Server_Name").ToString();
如果你想进一步了解ServerVariables,可以用
foreach(String o in Request.ServerVariables){
Response.Write(o+"="+Request.ServerVariables[o]+"<br>");
}
Request.ServerVariables.Get("Remote_Addr").ToString();
客户端主机名:
Request.ServerVariables.Get("Remote_Host").ToString();
客户端浏览器IE:
Request.Browser.Browser;
客户端浏览器 版本号:
Request.Browser.MajorVersion;//
客户端操作系统:
Request.Browser.Platform;
服务器ip:
Request.ServerVariables.Get("Local_Addr").ToString();
服务器名:
Request.ServerVariables.Get("Server_Name").ToString();
如果你想进一步了解ServerVariables,可以用
foreach(String o in Request.ServerVariables){
Response.Write(o+"="+Request.ServerVariables[o]+"<br>");
}
相关文章推荐
- C#如何获取客户端/服务端IP地址
- 在C#中服务端如何获取客户端的IP地址、端口号以及客户端和服务器连接的时间
- [转]C#如何获取客户端IP地址
- 服务端如何安全获取客户端请求IP地址
- nginx代理proxy如何获取客户端的真实IP地址
- JSP中如何获取客户端真实IP地址
- 获取webservice客户端IP地址 (C# java )
- 获取客户端和服务端的真实IP地址
- ASP如何获取客户端真实IP地址
- ASP如何获取客户端真实IP地址
- 负载均衡的场景下ASP.NET Core如何获取客户端IP地址
- ASP如何获取客户端真实IP地址
- Node.JS如何获取客户端IP地址
- C# 网站 获取客户端IP地址详细信息
- c# 获取客户端IP地址方法
- php如何获取客户端IP地址
- 如何获取用户客户端的IP地址
- c#中如何获取本机MAC地址、IP地址、硬盘ID、CPU序列号等系统信息
- C# 获取客户端IP地址
- c#中如何获取本机MAC地址、IP地址、硬盘ID、CPU序列号等系统信息