ASP.NETの中でどのようにユーザーのIEブラウザのバージョンを判断します

9746 ワード

f   (   Request.Browser.MajorVersion   ==   6   )
    {
    // to do
    }
    ......................................................................................................................................
    private   void   Page_Load(object   sender,   System.EventArgs   e)
    {
    HttpBrowserCapabilities bc = new HttpBrowserCapabilities();
    bc   =   Request.Browser;
    Label1.text=bc.Platform   +   "            :"   +   bc.Type;
    }
    ......................................................................................................................................
    HttpBrowserCapabilities   bc   =   Request.Browser;
    Response.Write("

:

"); Response.Write(" = " + bc.Type + "
"); Response.Write(" = " + bc.Browser + "
"); Response.Write(" = " + bc.Version + "
"); Response.Write(" = " + bc.MajorVersion + "
"); Response.Write(" = " + bc.MinorVersion + "
"); Response.Write(" = " + bc.Platform + "
"); Response.Write(" = " + bc.Beta + "
"); Response.Write("Is Crawler = " + bc.Crawler + "
"); Response.Write("Is AOL = " + bc.AOL + "
"); Response.Write("16 = " + bc.Win16 + "
"); Response.Write("32 = " + bc.Win32 + "
"); Response.Write(" Frame = " + bc.Frames + "
"); Response.Write(" Table = " + bc.Tables + "
"); Response.Write(" Cookies = " + bc.Cookies + "
"); Response.Write(" VB Script = " + bc.VBScript + "
"); Response.Write(" JavaScript = " + bc.JavaScript + "
"); Response.Write(" Java Applets = " + bc.JavaApplets + "
"); Response.Write(" ActiveX Controls = " + bc.ActiveXControls + "
"); Response.Write(" CDF = " + bc.CDF + "
"); Response.Write(Request.UserAgent); Response.Write (" language=<span style="color:#800000;">'</span><span style="color:#800000;">javascript</span><span style="color:#800000;">'</span>><span style="color:#008000;">//</span><span style="color:#008000;"> screenWidth=screen.widt</span> h;screenHeight=screen.height;"); // :Response.Write (window.screen.height); // :"+ window.screen.width; // :"+ window.screen.availHeight; // :"+ window.screen.availWidth

 
転載先:https://www.cnblogs.com/liuwj/p/3437995.html