Курсовая работа: Мониторинг ОС

GetMem(lpVolumeNameBuffer, MAX_PATH + 1);

GetMem(lpFileSystemNameBuffer, MAX_PATH + 1);

nVolumeNameSize := MAX_PATH + 1;

nFileSystemNameSize := MAX_PATH + 1;

lpRootPathName := PChar(FormDiski.DriveComboBox1.Drive+':\');

if GetVolumeInformation( lpRootPathName, lpVolumeNameBuffer,

nVolumeNameSize, @lpVolumeSerialNumber, lpMaximumComponentLength,

lpFileSystemFlags, lpFileSystemNameBuffer, nFileSystemNameSize )

then

begin

VolumeName.Caption := lpVolumeNameBuffer;

VolumeSerial.Caption := IntToHex(HIWord(lpVolumeSerialNumber), 4) + '-' + IntToHex(LOWord(lpVolumeSerialNumber), 4);

FileSystemName.Caption:= lpFileSystemNameBuffer;

GetDiskFreeSpace( PChar(DriveComboBox1.Drive+':\'), FSectorsPerCluster, FBytesPerSector, FFreeClusters, FTotalClusters);

end;

finally

FreeMem(lpVolumeNameBuffer);

FreeMem(lpFileSystemNameBuffer);

end;

SectorsPerCluster.Caption:=IntToStr(FSectorsPerCluster);

BytesPerSector.Caption:=IntToStr(FBytesPerSector);

end;

procedure TFormDiski.DriveComboBox1Change(Sender: TObject);

begin

UpdateDisk;

end;

procedure TFormDiski.BitBtn1Click(Sender: TObject);

begin

FormDiski.Visible:=False;

К-во Просмотров: 1460
Бесплатно скачать Курсовая работа: Мониторинг ОС