Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello,Friends
The Following code is working proper in ie and chrome but it is not working in firefox.



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


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

1 solution

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.
 
Share this answer
 
Comments
Shingala Anil 19-Mar-12 4:44am    
Hi....I want to get client machine name and IP address but Above my code is working good in Chrome and IE but in firefox its get server name and server ip address of Hosting Server..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900