Is the any function inside Ext.Net to retrieve User´s IP Adress?
Printable View
Is the any function inside Ext.Net to retrieve User´s IP Adress?
Hi,
The following demonstrates a few different options, see
http://www.geekpedia.com/KB32_How-do...P-address.html
This functionality is included with ASP.NET (.NET) and is not dependent on Ext.NET.
Hope this helps.
Here's the contents of the above post. I'll posts just in case the above disappears at some point.
Quote:
There are two possible ways, either using:
HttpContext.Current.Request.UserHostAddress;
or using
HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
Furthermore there is information that the below line retrieves the actual IP address and not the Proxy:
HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
Thank you for replying soon geoffrey,
i know the existing methods in C# to retrieve user´s IP, but i was looking for an way to get the LAN IP Address (behind the Proxy). I think that i am just gonna achieve this using ActiveX or VBScript :(
ok, thank you
I'll recomend use someting like this:
Code:string IP;
IP = Request.ServerVariables[ "HTTP_X_FORWARDED_FOR" ];
if ( IP == null )
{
IP = Request.ServerVariables[ "REMOTE_ADDR" ];
}
lblIP.Text = "IP " + IP;