I've got a webpart that presents a user on SharePoint with a simple button. On clicking the button I log the user that clicked it, the time and their IP address. The bit I can't figure out is how to find their IP address? Can I get to it through the SharePoint object model or do I have to do something more complicated?
private bool SignInCurrentUser()
{
SPWeb web = SPContext.Current.Web;
SPUser user = web.CurrentUser;
String address = "?";
SPList regList = web.Lists["SEED MEng Lab Registration List"];
SPListItem registration = regList.Items.Add();
registration["Student"] = user;
registration["Occurrence"] = DateTime.Now;
registration["IP Address"] = address;
registration.Update();
return true;
}