Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How to trace the system IP Address using Asp.net With coding any one help help me ?
Posted

1 solution

C#
using System;
using System.Web;

namespace WebApplication1
{
    public class Global : HttpApplication
    {
        protected void Application_BeginRequest(object sender, EventArgs e)
        {
            // Get request.
            HttpRequest request = base.Request;
    
            // Get UserHostAddress property.
            string address = request.UserHostAddress;
    
            // Write to response.
            base.Response.Write(address);
    
            // Done.
            base.CompleteRequest();
        }
    }
}


and refer this as well,
http://stackoverflow.com/questions/20027411/how-to-get-user-ip-address-in-asp-net[^]
http://stackoverflow.com/questions/735350/how-to-get-a-users-client-ip-address-in-asp-net[^]

-KR
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 28-Feb-14 0:03am    
5ed, hoping that this is what OP meant. The question is unclear.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900