I'm working on a ASP.NET Core project where I have a Login form, and I want to identify device from where the user is trying to login. This is what I find and what I use to get the IP:
userLogin.stringIP=Request.HttpContext.Connection.RemoteIpAddress.ToString();
With this I get only Local Gateway IP instead of local IP of device.
Update
The example code works,but when I publish the Website on my IIS Server it gives me the IP of IIS server, instead of device from where I try to acces the Website For example when I open the Website that is published on IIS server it gaves me the IP of IIS server.I need the device IP address from which I try to access the WebSite.
Any ideas / suggestions how to get local IP of device.
Thanks in advance!