快速取得访问者的操作系统版本、浏览器版本等信息

string browser = String.Format("{0}{1}",HttpContext.Current.Request.Browser.Browser,HttpContext.Current.Request.Browser.Version);
string platform = HttpContext.Current.Request.Browser.Platform;
if (HttpContext.Current.Request.UserAgent != null)
  {
    if(HttpContext.Current.Request.UserAgent.IndexOf("Windows NT 5.2")>=0)
    platform = "Win2003";
  }
this.lbl_Browser.Text = browser;
this.lbl_Platform.Text = platform;
this.lbl_Ip.Text = HttpContext.Current.Request.UserHostAddress;

posted on 2007-11-28 13:49  Sunlight  阅读(354)  评论(1编辑  收藏  举报

导航