Код | procedure GetDriveInfo(VolumeName: string; var VolumeLabel, SerialNumber, FileSystem: string); var VolLabel, FileSysName: array[0..255] of char; SerNum: pdword; MaxCompLen, FileSysFlags: dword;
begin New(SerNum); GetVolumeInformation(PChar(VolumeName), VolLabel, 255, SerNum, MaxCompLen, FileSysFlags, FileSysName, 255); VolumeLabel := VolLabel; SerialNumber := Format('%x', [SerNum^]); FileSystem := FileSysName; Dispose(SerNum); end;
procedure TForm1.Button1Click(Sender: TObject); var VolLabel, SN, FileSystem, S: string; begin s := 'g:\'; // имя CD дисковода GetDriveInfo(S, VolLabel, SN, FileSystem); Showmessage(VolLabel); end;
|
Взято с DelphiWorld |