Answers for "asp net saber ip address of client machine IIS"

C#
0

asp net saber ip address of client machine IIS

///  /// Get current user ip address. ///  /// The IP Address public static string GetUserIPAddress() { var context = System.Web.HttpContext.Current; string ip = String.Empty; if (context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null) ip = context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString(); else if (!String.IsNullOrWhiteSpace(context.Request.UserHostAddress)) ip = context.Request.UserHostAddress; if (ip == "::1") ip = "127.0.0.1"; return ip; }
Posted by: Guest on September-25-2020

Code answers related to "asp net saber ip address of client machine IIS"

C# Answers by Framework

Browse Popular Code Answers by Language