核心提示:function GetHardDiskPartitionType(const DriveLetter: Char): string; var NotUsed: DWORD; VolumeFlags:...
function GetHardDiskPartitionType(const DriveLetter: Char): string; var NotUsed: DWORD; VolumeFlags: DWORD; VolumeInfo: array[0..MAX_PATH] of Char; VolumeSerialNumber: DWORD; PartitionType: array[0..32] of Char; begin GetVolumeInformation(PChar(DriveLetter + ':\'), nil, SizeOf(VolumeInfo), @VolumeSerialNumber, NotUsed, VolumeFlags, PartitionType, 32); Result := PartitionType; end; //用法 procedure TForm1.Button1Click(Sender: TObject); begin ShowMessage(GetHardDiskPartitionType('c')); end;