gpt4 book ai didi

vb.net - HttpRequest.ServerVariables 与 HttpRequest.UserAgent 属性 VB.net

转载 作者:行者123 更新时间:2023-12-01 02:33:43 27 4
gpt4 key购买 nike

用于确定用户代理的这两个属性之间有什么区别(如果有)和优点/缺点?

Dim strUserAgt as String
userAgent = Request.userAgent

对比
Dim strUserAgt as String = Request.ServerVariables("HTTP_USER_AGENT")

最佳答案

来源:How to determine browser type in server-side code without the BrowserType object in ASP.NET

In ASP.NET, you can access the Request.ServerVariables collection or use the new Request.UserAgent property to retrieve the HTTP_USER_AGENT header value.



没有区别,两者都会检索相同的东西 HTTP_USER_AGENT header value .

查询 Request.ServerVariables CollectionIIS Server Variables如果你想深入挖掘它。这些服务器变量集合值在某种程度上也取决于 IIS 版本。

关于vb.net - HttpRequest.ServerVariables 与 HttpRequest.UserAgent 属性 VB.net,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11472820/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com