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

后端 未结 5 1214
不知归路
不知归路 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:52

    HttpContext.Current.Request.UserAgent.DefaultIfEmpty().Contains("Edge")

    DefaultIfEmpty() is an extension method I wrote that ensures empty string if the string is null.

提交回复
热议问题