Click here to Skip to main content
12,896,953 members (53,904 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET IPv6 Address
Actually i created one registration form in wanna get real ip address, who all register in my register form????
Posted 17-Nov-12 23:02pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This might be the best solution , to get the IP address

 public string GetUserIP()
            string ipList = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (!string.IsNullOrEmpty(ipList))
                return ipList.Split(',')[0];
            return Request.ServerVariables["REMOTE_ADDR"];
deenujii 18-Nov-12 5:17am
Sir....I need those code in c#....can u help me sir...
deenujii 18-Nov-12 5:19am
Actually I wanna trace all users whose r using my application...for that ly i need to get those pls help me?????
Pro Idiot 18-Nov-12 5:20am
The above code is in C# , Call the function and it will return you the user's Client IP
deenujii 18-Nov-12 5:27am
thank u sir....sir!!! pls i wanna keep touch with u!!!! how i can reach u sir?????
Pro Idiot 18-Nov-12 5:35am
If the solution helped, Mark as Answer.

U can reach via CP profile .

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 18 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100