Question

Locked

How to find IP address

By packer.lean ·
I am a .NET programmer and I am across an issue related to finding the IP address of the client computer. It is not tough to find that but the challenge comes if the client is hiding behind any proxy server or any gateway. What am I supposed to do if I want to find the IP of the client in such case.
I have searched the net regarding the matter but haven't come across anything helpful yet. or anything else? Any input in the matter will be helpful, be it any tool or new technology that I have to follow or any book/journal I have to refer or any URL that shall I visit. I don't know where and how to go ahead in the matter. Please help

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

How can we share the ip addresas for two computers?

by kesahey In reply to How to find IP address

I am using broad band service & i want to share the ip address for my two systems, is this posssible. I know my ip address through
the site named http://www.ip-details.com/. Now i want to share the ip on both systems. Need help pls...........

Collapse -

You have posted your question

by tintoman In reply to How can we share the ip a ...

In someone else's thread, you need to click on the "ask a question" button and re-submit it

Collapse -

tcp ip header

by maxpowers410 In reply to How to find IP address

i guess u could analyse the tcpip header, im not sure but maybe the soucre and destination will be in there,but imnot sure if that gets over written by the proxy...

Collapse -

Reply to - How to find IP address

by cmaryg In reply to How to find IP address

There are 2 types of proxies (or proxy configurations):
1. Those that send information about their clients
2. Those that don't

You can look into the HTTP_X_FORWARDED_FOR and CLIENT_IP environment variables to get at least some additional information in case (1) - its use depends on the proxy.
You are lost in case (2), though.
If you want to find the IP address of visitors to your aspx page or application or want to retrieve IP for other uses than u need to write this code (ASP.NET)

Using this code you can find IP address of visitor even if visitor is behind any proxy
public string IpAddress()
{
string strIpAddress;
strIpAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (strIpAddress == null)
{
strIpAddress = Request.ServerVariables["REMOTE_ADDR"];
}
return strIpAddress;
}

To find IP address of a machine behind LAN you can use this code
string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress = System.Net.Dns.GetHostAddresses
(strHostName).GetValue(1).ToString();

Back to Networks Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums