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
Loading
CrishPosted Mar 30, 2011, 1:32 AM
Krishna GaradPosted Mar 30, 2011, 12:31 AM
(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();
}