I'm using Request.UserHostAddress
in a C# ASP.NET MVC web application to get the IP address of the client.
Request.UserHostAddress
returns a string which is simple enough to convert into its integer form. However, this appears to be 2 levels of inefficiency because deep in the bowels of the .Net stack it probably takes the integer representation of the IP address and converts it to a string before my code converts it back to an integer.
Can I get the integer representation of the client's IPv4 address directly from .NET?