Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Request.UserHostAddress
- string VisitorIPAddress = Request.UserHostAddress.ToString();
- public static String GetIPAddress()
- {
- String ip = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
- if (string.IsNullOrEmpty(ip))
- ip = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
- else
- ip = ip.Split(',')[0];
- return ip;
- }
- Request.UserHostAddress
- Request.UserHostAddress
Add Comment
Please, Sign In to add comment