Article: How to get IP Address of Visitors Machine in ASP.Net
How to get IPAddress in asp.net core 8.
The following example give me error:
string ipAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
Hi moepyag,
Please share the error details you are getting.
@slope game What error message you're receiving?
This way
var remoteIpAddress = request.HttpContext.Connection.RemoteIpAddress;
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.