Click here to Skip to main content
16,019,843 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear Developer,

I am a Web Developer in Mumbai. I created a website for our company ie. www.onkarelearnings.com and i want to fetch and show the IP ADdress who visit our website and store it in database. only for security reason.
All it wants in C# and SQL. So please help me to sortout my problem.
Please send me detailed code for that.

Thanks in advanced.
Posted

Getting the visitor's IP is simple: just use the HttpContext.Current.Request.UserHostAddress[^]

Presumably you know how to add records to a database: just create a field with enough space to hold the IP address
 
Share this answer
 
See this links
Link 1[^]
Code project's link
Link2[^]
Link3[^]
 
Share this answer
 
For this you want to use Request.UserHostAddress. This is a property of the visitors IP address

MSDN: MSDN Reference[^]

Please mark as answered if this helps you!!!
 
Share this answer
 
Hope this[^] might help you.
 
Share this answer
 

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