How To Get IP Address in C#
Last Updated 2/23/2017
Get the visitor's IP address in C#
Whenever a browser sends a request for a page, it also sends a number of other headers to the script, containing information such as the browser type. It also includes information such as the visitors IP address.
In C# you can get the IP address of your users from the Request.ServerVariables collection. The following C# code will display the visitor’s IP: