无法在Firefox中找到客户端计算机名称和IPAddress [英] Cant find Client Machine Name and IPAddress In Firefox

查看:88
本文介绍了无法在Firefox中找到客户端计算机名称和IPAddress的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,朋友们
以下代码在ie和chrome中正常工作,但在Firefox中不工作.



hello,Friends
The Following code is working proper in ie and chrome but it is not working in firefox.



IPAddress = Request.ServerVariables("REMOTE_HOST").ToString()
            CompName = System.Net.Dns.GetHostEntry(Request.ServerVariables("remote_addr")).HostName.Split(".").GetValue(0).ToString()



在IE和Chrome中,获取客户端计算机名称和客户端IPAddress,而在Firefox中,获取服务器名称和服务器IPAddress.



In IE and Chrome Get Client Machine Name And Client IPAddress But In Firefox Get ServerName And Server IPAddress.

推荐答案

那么REMOTE_HOST的值是多少?在尝试反向IP地址之前,请确保您拥有一个IP地址,并且该地址不在不可路由的范围之内.

顺便说一句,由于ServerVariables返回的任何内容始终都是字符串,因此您无需在其上调用ToString.
So what''s the value of REMOTE_HOST? Before you go trying to reverse the IP address, make sure you HAVE an IP address and that it is not in one of the non-routable ranges.

BTW, since anything that is returned by ServerVariables is always a string, you don''t need to call ToString on it.


这篇关于无法在Firefox中找到客户端计算机名称和IPAddress的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆