Click here to Skip to main content
15,867,330 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have a web application in that i have to store action performed in a page by admin and want to know from which system name/ip modification is carried out please let me know how to implement it.

Thanking You
Mohd. wasif
Posted

u can store IP address of client in ur database using

C++
Request.UserHostAddress
 
Share this answer
 
The HttpRequest class has a UserHostAddress and UserHostName to get the IP and Domain Names respectively. The Page object has a Request object of type HttpRequest, so you should be able to put this in code behind:

string originatingIp = Request.UserHostAddress


After that it is up to you how you store it!

Note that, across the Internet Especially, you might get the IP of the orginating network, rather than the machine where machines share a network. For example a shared routed at home or from a company. Within a local network you should be fine however.
 
Share this answer
 
VB
Dim client_ip as string
client_ip = Request.UserHostAddress()


Store the client IP.
 
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