网站如何找到它们 请求来自浏览器或任何其他

发布于 2024-09-01 06:11:53 字数 26 浏览 3 评论 0原文

网站如何检查请求是否来自浏览器或程序。

how website checked that a request come from a browser or from a programs.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

许久 2024-09-08 06:11:53

在 javascript 中,您可以使用 navigator.userAgent。请注意,这可能因浏览器而异。可以在以下位置找到如何使用它的一个很好的示例
怪异模式

但请注意,您可以随时使用适当的浏览器、脚本或代码编辑 userAgentString。所以对结果没有绝对的保证——但至少是一个起点。

干杯,
马库斯

in javascript you may use navigator.userAgent. note that this may vary from browser to browser. a good example how to use it can be found at
quirksmode.

However be aware that you can edit the userAgentString at any time using the appropriate browser, script or code. so no absolute guarantee on the result - but at least a starting point.

cheers,
markus

小伙你站住 2024-09-08 06:11:53

如果您希望使用服务器端代码,并且假设您使用的是 .net,则 Request.Browser 属性将提供发出请求的代理的详细信息。

If you would prefer to use server side code, and presuming you are using .net, the Request.Browser property will provide details of the agent making the request.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文