Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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; } 
Source by csharp.dokry.com #
 
PREVIOUS NEXT
Tagged: #asp #net #saber #ip #address #client #machine #IIS
ADD COMMENT
Topic
Name
3+8 =