Here is the code for displaying the IP Address of your visitor in ASP.NET
Hope this comes handyCode:string trueip = string.Empty; ip = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (!string.IsNullOrEmpty(ip)) { string[] iprange = ip.Split(','); trueip = iprange[0].Trim(); } else { trueip = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; }![]()



Reply With Quote


Bookmarks