#region 取得远程的IP地址和浏览器类型
/// <summary>
/// 取得远程的IP地址和浏览器类型
/// </summary>
/// <returns></returns>
public static string GetIp()
{
string str = "";
//穿过代理服务器取远程用户真实IP地址:
if (System.Web.HttpContext.Current.Request.ServerVariables["HTTP_VIA"] != null)
str = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
else
str = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].ToString();
HttpBrowserCapabilities bc = new HttpBrowserCapabilities();
bc = System.Web.HttpContext.Current.Request.Browser;
str += " 你的操作系统:" + bc.Platform + " 浏览器:" + bc.Type;
return str;
}
#endregion

1260

被折叠的 条评论
为什么被折叠?



