Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want get client IP from web browser using Proxy (ISA Server), I using Request.ServerVariables["REMOTE_HOST"] or Request.ServerVariables["REMOTE_ADDR"] alway return IP of server ISA Server.
ex: My Computer have Static IP 10.1.164.68 and IP of ISA Server is 192.168.1.50, and in Browser declare connect to Internet through ISA Server, when I using Request.ServerVariables["REMOTE_HOST"] or Request.ServerVariables["REMOTE_ADDR"] Its always return IP 192.168.1.50. How can I get real IP of My Computer (IP:10.1.164.68).

Thanks for reading.

Kevin Ho
Posted
Updated 25-May-11 0:49am
v2
Comments
raju melveetilpurayil 25-May-11 6:50am    
[edit] for more readability[/edit]

The only way to get the internet IP address is to access a site that is outside your local network: i.e. on the internet.

If Request.ServerVariables is telling you that the IP address is 192.168.x.x then that is a good indication that both the server and the client are on the same local network (192.168.x.x is generally allocated by routers to internal computers).

If one or other of the server and client is outside the network, then the internet IP address is available.
 
Share this answer
 
hi
here is the code to get ip address

MIDL
IPAddress[] localIPs = Dns.GetHostAddresses(Dns.GetHostName());
           string ipadd = localIPs[0].ToString();



this will help u
 
Share this answer
 
Comments
Member 9957268 18-Apr-13 7:25am    
Sir using above code i got link-local address :=
but i want static address

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