本文介绍了如何检测新的Microsoft浏览器“ Edge”在asp.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在asp.net中,使用此结构,我如何检测新的Microsoft Edge浏览器?
In asp.net, using this construct, how might I detect the new Microsoft "Edge" browser?
Dim wrkBrowser As String = ""
Dim wrkBrowserType As String = HttpContext.Current.Request.Browser.Type
If InStr(wrkBrowserType, "Chrome") <> 0 Then
wrkBrowser = "Chrome"
End If
If InStr(wrkBrowserType, "MSIE") <> 0 Then
wrkBrowser = "IE"
End If
If InStr(wrkBrowserType, "FireFox") <> 0 Then
wrkBrowser = "FF"
End If
推荐答案
我不是任何.NET的专家,但阅读您的代码后,在我看来
I am not an adept in anything .NET, but reading your code, it seems to me that the value returned by
HttpContext.Current.Request.Browser.Type
是用户代理。
您可以在页面。
边缘用户代理:
请注意,该值可以根据移动设备,xbox等进行更改。
Note that the value can change based on mobile, xbox, etc.
因此,请尝试在边缘上进行检查
So in your case, try doing a check on "Edge"
这篇关于如何检测新的Microsoft浏览器“ Edge”在asp.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!