0
点赞
收藏
分享

微信扫一扫

判断浏览器的类别

墨春 2023-11-07 阅读 60

Dim isSafari As Boolean = False   
            Dim bc As HttpBrowserCapabilities = Request.Browser                 If bc.Type.IndexOf("Apple") > 0 Or bc.Type.IndexOf("Safari") > 0 Or bc.Browser.IndexOf("Apple") > 0 Or bc.Browser.IndexOf("Safari") > 0 Then    
                isSafari = True    
            End If    
            If isSafari Then    
                Me.btnGenerateRePort.Attributes.Add("onclick", "this.form.target='_blank'")    
            End If 
       bool isSafari = false;   
       bool isFireFox = false;    
       HttpBrowserCapabilities hbc = Request.Browser;    
       if (hbc.Type.IndexOf("Safari")>=0 || hbc.Type.IndexOf("Apple")>=0    
           || hbc.Browser.IndexOf("Safari") >= 0 || hbc.Browser.IndexOf("Apple") >= 0)    
       {    
           isSafari = true;    
       }    
       if (hbc.Type.IndexOf("Gecko") >= 0 || hbc.Type.IndexOf("Firefox") >= 0    
           || hbc.Browser.IndexOf("Gecko") >= 0 || hbc.Browser.IndexOf("Firefox") >= 0)    
       {    
           isFireFox = true;    
       }

举报

相关推荐

0 条评论