Fail to obtain the computer information from php5.3 // Phpinfo ();
// Exit;
/** Obtain the hard disk serial number */
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;
}
/** Obtain the CPU serial number */
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;
}
/** Obtain the serial number of the motherboard */
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 ());
The younger brother of MySQL 5.2 is here to help you.
Reply to discussion (solution)
Since php5.3, the COM extension is no longer loaded by default.
Php. ini
Extension = php_com_dotnet.dll
Moderator. I don't know where to download it.
You do not need to download. the ext directory contains
What is the function of retrieving this item? Is the program bound to a computer?
Well, that's it.