Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
检测在 HTTP 客户端上运行的操作系统的最佳方法是什么?我知道浏览器的User-Agent可能是伪造的。那么我应该使用 HTTP 的句柄吗?从 WinXP 和 Win7 发送的 HTTP 数据包有什么区别吗?我只需要检测这些。
User-Agent
Windows XP 的用户代理字符串是Windows NT 5.1或Windows XP。
Windows NT 5.1
Windows XP
例如,在 JavaScript 中,返回必要的字符串:
function osInfo() { alert(window.navigator.oscpu); } // returns: "Windows NT 6.0" for example