Hi All,
I want to track the user IP address.
I have tried using DNS & Request objects to get the user IP address. Its working only in local PC not in server. May be this is because i'm missing a step to implement in server.
So, Please give me a solution other than using DNS & Request objects (or) please explain me how to implement this DNS & Request.
Thanks All,
Manohar
Tracking IP Address
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Krishna GaradRank #191 · 12.8K reputationPosted Mar 29, 2011, 8:31 PM EDT
(System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create("http://www.whatismyip.org");
request.UserAgent = "User-Agent: Mozilla/4.0 (compatible; MSIE" +
"6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
System.Net.HttpWebResponse response =
(System.Net.HttpWebResponse)request.GetResponse();
using (System.IO.StreamReader reader = new
StreamReader(response.GetResponseStream()))
{
string myExternalIP = reader.ReadToEnd();
reader.Close();
}
CrishRank #1,487 · 1.1K reputationPosted Mar 29, 2011, 9:32 PM EDT