Home > Backend Development > PHP Tutorial > 跪求php5.3版本获取不到电脑的信息

跪求php5.3版本获取不到电脑的信息

WBOY
Release: 2016-06-23 14:23:20
Original
815 people have browsed it

//phpinfo();

//exit;
/** 取硬盘序列号 */
function getDiskSID(){
$sid = array();
$wmd = new COM("Winmgmts://./root/cimv2");
$wqd = $wmd->ExecQuery("Select * From Win32_DiskDrive");
foreach($wqd as $row){
$sid[] = $row->PNPDeviceID;
}
return $sid;
}

/** 取CPU序列号 */
function getCpuSID(){
$sid = array();
$objLocator = new COM("WbemScripting.SWbemLocator");
$wmi = $objLocator->ConnectServer();
//$info=$wmi->Get("Win32_PnPEntity");
$info = $wmi->Get("Win32_Processor");
$arrProp = $info->Properties_();
$arrWEBMCol = $info->Instances_();
foreach($arrWEBMCol as $objItem) {
$sid[] = $objItem->ProcessorId;
}
return $sid;
}

/** 取主板序列号 */
function getBoardSID(){
$sid = array();
$objLocator = new COM("WbemScripting.SWbemLocator");
$wmi = $objLocator->ConnectServer();
$info = $wmi->Get("Win32_BaseBoard");
$arrWEBMCol = $info->Instances_();
foreach($arrWEBMCol as $row){
$sid[] = $row->SerialNumber ;
}
return $sid;
}

var_dump(@getBoardSID());
var_dump(@getDiskSID());
var_dump(@getCpuSID());


5.2版本都能行  小弟在这里跪求大侠些帮忙啊


回复讨论(解决方案)

php5.3 起,COM 扩展不再是默认加载的了
php.ini
extension=php_com_dotnet.dll

 版主啊 就是这个 不知道那里下载啊 找了不安踏了

不需要下载,ext 目录中就有

取这个东西有什么作用嘛?程序绑定计算机?

嗯是这样的啊

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template