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.