Hi
I have below code but it is returning :: 1
private string GetIpAddress()
{
string IpAddress = string.Empty;
try
{
IpAddress = Request.ServerVariables["HTP_X_FORWARDED_FOR"];
if (IpAddress == " " || IpAddress == null)
{
IpAddress = Request.ServerVariables["REMOTE_ADDR"];
return IpAddress;
}
else
{
return IpAddress;
}
}
catch (ArgumentNullException Exc)
{
Label2.Text = "Application Error : " + Exc.Message;
return IpAddress;
}
catch (InvalidCastException Exc)
{
Label2.Text = "Application Error : " + Exc.Message;
return IpAddress;
}
catch (InvalidOperationException Exc)
{
Label2.Text = "Application Error : " + Exc.Message;
return IpAddress;
}
catch (NullReferenceException Exc)
{
Label2.Text = "Application Error : " + Exc.Message;
return IpAddress;
}
catch (Exception Exc)
{
Label2.Text = "Application Error : " + Exc.Message;
return IpAddress;
}
}
Thanks