strHostName = System.Net.Dns.GetHostName() strIPAddress = GetHostByName(strHostName).AddressList(0).ToString() Response.Write(Request.Params("REMOTE_ADDR")) Response.Write(HttpContext.Current.Request.ServerVariables("REMOTE_ADDR")) Response.Write(HttpContext.Current.Request.UserHostAddress) Response.Write(Page.Request.ServerVariables("REMOTE_ADDR")) Response.Write(Page.Request.ServerVariables("LOCAL_ADDR"))
public String getIpAddress() { string strIpAddress; strIpAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (strIpAddress == null) { strIpAddress = Request.ServerVariables["REMOTE_ADDR"]; } return Convert.ToString(strIpAddress); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)