Sometime as par business requirement we need to have
client machine IP address mean get the IP address of that client machine from
which user is visited your web site.
To achieve this use below line of code:
string IPAddress = string.Empty;
IPAddress =
Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (IPAddress == ""
|| IPAddress == null)
IPAddress =
Request.ServerVariables["REMOTE_ADDR"];
Response.Write("<b>Your
Machine IP Address is: </b>" + IPAddress);
Output:

Image 1.