[ASP.Net]在 ASP.NET Web 網頁中偵測瀏覽器類型

資料來源:http://msdn.microsoft.com/zh-tw/library/3yekbd5b%28v=vs.100%29.aspx

智慧型手機的興起,搞得很多客戶都會要求使用手機上網監看監控系統的訊息‧可是很鐵不成鋼的Indusoft目前還僅能支援Microsoft IE...

所以身為高級保險業務員的我得拿出看家擦屁股的本領來想解決方案

這是第一個步驟,使用ASP.net來偵測連線進來的Client(客戶端)是使用哪一種瀏覽器。


  1 Private Sub Button1_Click(ByVal sender As System.Object, _
  2        ByVal e As System.EventArgs) Handles Button1.Click
  3     Dim s As String = ""
  4     With Request.Browser
  5         s &= "Browser Capabilities" & vbCrLf
  6         s &= "Type = " & .Type & vbCrLf
  7         s &= "Name = " & .Browser & vbCrLf
  8         s &= "Version = " & .Version & vbCrLf
  9         s &= "Major Version = " & .MajorVersion & vbCrLf
 10         s &= "Minor Version = " & .MinorVersion & vbCrLf
 11         s &= "Platform = " & .Platform & vbCrLf
 12         s &= "Is Beta = " & .Beta & vbCrLf
 13         s &= "Is Crawler = " & .Crawler & vbCrLf
 14         s &= "Is AOL = " & .AOL & vbCrLf
 15         s &= "Is Win16 = " & .Win16 & vbCrLf
 16         s &= "Is Win32 = " & .Win32 & vbCrLf
 17         s &= "Supports Frames = " & .Frames & vbCrLf
 18         s &= "Supports Tables = " & .Tables & vbCrLf
 19         s &= "Supports Cookies = " & .Cookies & vbCrLf
 20         s &= "Supports VBScript = " & .VBScript & vbCrLf
 21         s &= "Supports JavaScript = " & _
 22             .EcmaScriptVersion.ToString() & vbCrLf
 23         s &= "Supports Java Applets = " & .JavaApplets & vbCrLf
 24         s &= "Supports ActiveX Controls = " & .ActiveXControls & _
 25             vbCrLf
 26         s &= "Supports JavaScript Version = " & _
 27             Request.Browser("JavaScriptVersion") & vbCrLf
 28     End With
 29     TextBox1.Text = s
 30 End Sub




留言

這個網誌中的熱門文章

[Excel]將圖片放置於儲存格中

[軟體]AUTOCAD關於開啟圖面時,字型找不到,而要手動指定成 chineset.shx 字型檔問題

[MS SQL]查詢資料庫中每個資料表之列數與資料表大小(容量)資訊。Get size of all tables in database