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();
        }

Admin

A Software Engineer, Social Media Marketing Expert, writer,

Post a Comment

Previous Post Next Post