public static string GetClientIP() { string ip = ""; try { if (HttpContext.Current.Request.ServerVariables["HTTP_VIA"] != null) { ip = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString(); } else { ip = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].ToString(); } } catch { } return ip; } public static string GetClientName() { string ip = GetClientIP(); try { ip = "" + System.Net.Dns.GetHostByAddress(ip).HostName; } catch { } return ip; }