问题描述
我需要获取某些操作系统级别的信息。我无法在客户端计算机上安装任何软件,只能选择在客户端计算机的浏览器中打开URL。如果可能,我需要获取以下信息。
- 获取操作系统版本
- 他们是否运行Windows Update
- 任何待处理的软件都会重新启动等待(从软件安装开始),这会导致SentryBay安装出现问题
- 音频设置
- cpu
- RAM
- 应该仅运行Defender(对于PC)
- 他们在使用wifi
- PC上正在运行什么(如果cpu使用率很高,则可能需要关闭或卸载软件)
- 安全模式需要关闭
网站可以使用任何语言JS,PHP,Python等进行编码。
谢谢。
解决方法
出于安全方面的考虑,大多数操作是不可能的,但是某些浏览器已实现了可以访问某些信息的Web API。 What Web Can Do Today掌握了一些很棒的信息,说明使用主要为Progressive Web Applications设计的API可以访问哪些设备特定的数据。
更新:有关如何使用JavaScript here
访问操作系统版本的信息 ,嗯,实际上您可以使用PHP获得设备的操作系统信息。它可以使用以下代码告诉用户是否正在使用Windows 7或Windows 8或Windows 10或Android或Mac OS或IOS或更多:
<?php
$user_agent = $_SERVER['HTTP_USER_AGENT'];
function getOS() {
global $user_agent;
$os_platform = "Unknown OS Platform";
$os_array = array(
'/windows nt 10/i' => 'Windows 10','/windows nt 6.3/i' => 'Windows 8.1','/windows nt 6.2/i' => 'Windows 8','/windows nt 6.1/i' => 'Windows 7','/windows nt 6.0/i' => 'Windows Vista','/windows nt 5.2/i' => 'Windows Server 2003/XP x64','/windows nt 5.1/i' => 'Windows XP','/windows xp/i' => 'Windows XP','/windows nt 5.0/i' => 'Windows 2000','/windows me/i' => 'Windows ME','/win98/i' => 'Windows 98','/win95/i' => 'Windows 95','/win16/i' => 'Windows 3.11','/macintosh|mac os x/i' => 'Mac OS X','/mac_powerpc/i' => 'Mac OS 9','/linux/i' => 'Linux','/ubuntu/i' => 'Ubuntu','/iphone/i' => 'iPhone','/ipod/i' => 'iPod','/ipad/i' => 'iPad','/android/i' => 'Android','/blackberry/i' => 'BlackBerry','/webos/i' => 'Mobile'
);
foreach ($os_array as $regex => $value)
if (preg_match($regex,$user_agent))
$os_platform = $value;
return $os_platform;
}
$user_os = getOS();
$device_details = "<strong>Operating System: </strong>".$user_os."";
print_r($device_details);
?>