Home  >  Article  >  Backend Development  >  跪求php5.3版本获取不到计算机的信息

跪求php5.3版本获取不到计算机的信息

WBOY
WBOYOriginal
2016-06-13 12:35:55809browse

跪求php5.3版本获取不到电脑的信息
//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版本都能行  小弟在这里跪求大侠些帮忙啊

Statement:
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