检索磁盘的几何结构扩展信息.
#Include <WinAPIEx.au3>
_WinAPI_GetDriveGeometryEx ( $iDrive )
| $iDrive | 驱动器号,如 D:, E:, 等等. |
| Success | The array containing the following information: |
| [0] | The number of cylinders. |
| [1] | The type of media. |
| [2] | The number of tracks per cylinder. |
| [3] | The number of sectors per track. |
| [4] | The number of bytes per sector. |
| [5] | The disk size, in bytes. |
| 失败: | 返回 0 并设置 @error 标志为非 0 值. |
在MSDN中搜索
#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global $Data, $Drive = 0
While 1
$Data = _WinAPI_GetDriveGeometryEx($Drive)
If @error Then
ExitLoop
EndIf
If Not $Drive Then
ConsoleWrite('-------------------------------' & @CR)
EndIf
ConsoleWrite('Drive: ' & $Drive & @CR)
ConsoleWrite('Cylinders: ' & $Data[0] & @CR)
ConsoleWrite('Tracks per Cylinder: ' & $Data[2] & @CR)
ConsoleWrite('Sectors per Track: ' & $Data[3] & @CR)
ConsoleWrite('Bytes per Sector: ' & $Data[4] & @CR)
ConsoleWrite('Total Space: ' & $Data[5] & ' bytes' & @CR)
ConsoleWrite('-------------------------------' & @CR)
$Drive +=1
WEnd