Getting Serial Number of the Hard Drive Provided by the manufacturer through PHP

后端 未结 9 716
时光取名叫无心
时光取名叫无心 2020-12-17 03:36

Getting Serial Number of the Hard Drive Provided by the manufacturer through PHP : How can it be done? I want to store it in a file.

OS : windows 2000,XP,ME,Vista.

9条回答
  •  死守一世寂寞
    2020-12-17 03:57

    PHP itself has no way of accessing the hardware like that.

    You will have to either

    • use a command of your operating system and call it with system() or exec()
    • write an extension for PHP that will return you the information

    If you are on Linux and have the necessary privileges and configuration you can use $r = system("hdparm -I /dev/hda"); (replace hda with your hd) to get the serial number of a given hard drive.

提交回复
热议问题