Pages

Subscribe:

Ads 468x60px

Thursday, March 1, 2012

how to access or track the IP address of the vistor using asp.net

see the below code it will help you to access the or get or track the IP address of the visitor in asp.net

_ipAddress = Request.UserHostAddress.ToString();
        _ipAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        if (_ipAddress == null || _ipAddress == "")
        {
            _ipAddress = Request.ServerVariables["REMOTE_ADDR"].ToString();
        }

No comments:

Post a Comment