WinAPI Extended UDF#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global $Bus, $Text, $Drive = DriveGetDrive('FIXED')
For $i = 1 To $Drive[0]
$Bus = _WinAPI_GetDriveBusType($Drive[$i])
Switch $Bus
Case $DRIVE_BUS_TYPE_UNKNOWN
$Text = 'UNKNOWN'
Case $DRIVE_BUS_TYPE_SCSI
$Text = 'SCSI'
Case $DRIVE_BUS_TYPE_ATAPI
$Text = 'ATAPI'
Case $DRIVE_BUS_TYPE_ATA
$Text = 'ATA'
Case $DRIVE_BUS_TYPE_1394
$Text = '1394'
Case $DRIVE_BUS_TYPE_SSA
$Text = 'SSA'
Case $DRIVE_BUS_TYPE_FIBRE
$Text = 'FIBRE'
Case $DRIVE_BUS_TYPE_USB
$Text = 'USB'
Case $DRIVE_BUS_TYPE_RAID
$Text = 'RAID'
Case $DRIVE_BUS_TYPE_ISCSI
$Text = 'ISCSI'
Case $DRIVE_BUS_TYPE_SAS
$Text = 'SAS'
Case $DRIVE_BUS_TYPE_SATA
$Text = 'SATA'
Case $DRIVE_BUS_TYPE_SD
$Text = 'SD'
Case $DRIVE_BUS_TYPE_MMC
$Text = 'MMC'
EndSwitch
ConsoleWrite(StringUpper($Drive[$i]) & ' => ' & $Text & @CR)
Next
借用DriveGetDrive('FIXED')返回以下文件,但怎样才可以自定义一个函数返回这些数组呢?
比如自定义一个函数 “_DriveGetDrive(' ')” 当使用 _DriveGetDrive('FIXED') 时返回一组数组分别为:C:~F: ,
_DriveGetDrive('REMOVABLE_DISK') 返回一组数组分别为:H: 呢?
谢谢!
C: => ATA
D: => ATA
E: => ATA
F: => ATA
H: => USB |