Я когда-то искал серийный номер жесткого диска без использования WMI, и я нашел его. qaru.site/info/507898/..., очень хорошо работает на 32-битных Windows, как XP, так и Vista. Проблема возникает только тогда, когда я пытаюсь получить серийный номер на 64-битных ОС (Vista Ultimate 64, в частности). Код возвращает String.Empty или пробел все время.
Кто-нибудь понял, как это исправить?
EDIT:
Я использовал инструменты Dave Cluderay, предлагающие интересные результаты:
Вот результат работы с DiskId32 на 32-разрядной версии Windows XP SP2:
To get all details use "diskid32 /d"
Trying to read the drive IDs using physical access with admin rights
Drive 0 - Primary Controller - - Master drive
Drive Model Number________________: [MAXTOR STM3160215AS]
Drive Serial Number_______________: [ 6RA26XK3]
Drive Controller Revision Number__: [3.AAD]
Controller Buffer Size on Drive___: 2097152 bytes
Drive Type________________________: Fixed
Drive Size________________________: 160041885696 bytes
Trying to read the drive IDs using the SCSI back door
Drive 4 - Tertiary Controller - - Master drive
Drive Model Number________________: [MAXTOR STM3160215AS]
Drive Serial Number_______________: [ 6RA26XK3]
Drive Controller Revision Number__: [3.AAD]
Controller Buffer Size on Drive___: 2097152 bytes
Drive Type________________________: Fixed
Drive Size________________________: 160041885696 bytes
Trying to read the drive IDs using physical access with zero rights
**** STORAGE_DEVICE_DESCRIPTOR for drive 0 ****
Vendor Id = []
Product Id = [MAXTOR STM3160215AS]
Product Revision = [3.AAD]
Serial Number = []
**** DISK_GEOMETRY_EX for drive 0 ****
Disk is fixed
DiskSize = 160041885696
Trying to read the drive IDs using Smart
Drive 0 - Primary Controller - - Master drive
Drive Model Number________________: [MAXTOR STM3160215AS]
Drive Serial Number_______________: [ 6RA26XK3]
Drive Controller Revision Number__: [3.AAD]
Controller Buffer Size on Drive___: 2097152 bytes
Drive Type________________________: Fixed
Drive Size________________________: 160041885696 bytes
Hard Drive Serial Number__________: 6RA26XK3
Hard Drive Model Number___________: MAXTOR STM3160215AS
И DiskId32 запускается в Windows Vista Ultimate 64-бит:
To get all details use "diskid32 /d"
Trying to read the drive IDs using physical access with admin rights
Trying to read the drive IDs using the SCSI back door
Trying to read the drive IDs using physical access with zero rights
**** STORAGE_DEVICE_DESCRIPTOR for drive 0 ****
Vendor Id = [MAXTOR S]
Product Id = [TM3160215AS]
Product Revision = [3.AA]
Serial Number = []
**** DISK_GEOMETRY_EX for drive 0 ****
Disk is fixed
DiskSize = 160041885696
Trying to read the drive IDs using Smart
Hard Drive Serial Number__________:
Hard Drive Model Number___________:
Обратите внимание, насколько меньше информация указана в Vista и как не возвращается серийный номер. Также другой инструмент EnumDisk относится к моим жестким дискам в Vista как "SCSI", а не к "ATA" в Windows XP.
Любые идеи?
ИЗМЕНИТЬ 2:
Я отправляю результаты из EnumDisks:
В Windows XP SP2 32-бит:
Properties for Device 1
Device ID: IDE\DiskMAXTOR_STM3160215AS_____________________3.AAD___
Adapter Properties
------------------
Bus Type : ATA
Max. Tr. Length: 0x20000
Max. Phy. Pages: 0xffffffff
Alignment Mask : 0x1
Device Properties
-----------------
Device Type : Direct Access Device (0x0)
Removable Media : No
Product ID : MAXTOR STM3160215AS
Product Revision: 3.AAD
Inquiry Data from Pass Through
------------------------------
Device Type: Direct Access Device (0x0)
Vendor ID : MAXTOR S
Product ID : TM3160215AS
Product Rev: 3.AA
Vendor Str :
*** End of Device List ***
И на Vista 64 Ultimate:
Properties for Device 1
Device ID: SCSI\DiskMAXTOR_STM3160215AS_____3.AA
Adapter Properties
------------------
Bus Type : FIBRE
Max. Tr. Length: 0x20000
Max. Phy. Pages: 0x11
Alignment Mask : 0x0
Device Properties
-----------------
Device Type : Direct Access Device (0x0)
Removable Media : No
Vendor ID : MAXTOR S
Product ID : TM3160215AS
Product Revision: 3.AA
Inquiry Data from Pass Through
------------------------------
Device Type: Direct Access Device (0x0)
Vendor ID : MAXTOR S
Product ID : TM3160215AS
Product Rev: 3.AA
Vendor Str :
*** End of Device List ***