How to Detect new Microsoft browser “Edge” in asp.net

后端 未结 5 1228
不知归路
不知归路 2020-12-18 11:14

In asp.net, using this construct, how might I detect the new Microsoft \"Edge\" browser?

    Dim wrkBrowser As String = \"\"
    Dim wrkBrowserType As String         


        
5条回答
  •  忘掉有多难
    2020-12-18 11:42

    As Joey mentioned, the User Agent string is what you want to look at. The properties of Request.Browser don't contain anything specific to Edge, but you can get the user agent string with HttpContext.Current.Request.UserAgent and use .IndexOf("Edge") to search it.

提交回复
热议问题