here this code describes how to get client IP detail using asp.net c#
string hostIPAdd = null;
string hostName = null;
string clientIP = null;
string clientGateWay = null;
string strDNS = null;
string strHostName = System.Net.Dns.GetHostName();
hostIPAdd = this.Page.Request.ServerVariables["REMOTE_ADDR"].ToString();
hostName = HttpContext.Current.Request.UserHostName;
clientIP = System.Net.Dns.GetHostByName(strHostName).AddressList.GetValue(0).ToString();
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adapter in adapters)
{
IPInterfaceProperties adaProperties = adapter.GetIPProperties();
GatewayIPAddressInformationCollection add = adaProperties.GatewayAddresses;
if (add.Count > 0)
{
foreach (GatewayIPAddressInformation address in add)
{
clientGateWay += address.Address.ToString();
}
}
IPAddressCollection cip = adapter.GetIPProperties().DnsAddresses;
foreach (System.Net.IPAddress ip in ip)
{
strDNS = cip.ToString();
}
}