Espaco livre HD
Gostaria de saber como obter o espaço total e o livre do HD.
Obrigado.
Obrigado.
M@rcio
Curtidas 0
Respostas
Nigro
08/01/2004
var SetoresPorAgrup, BytesPorSetor, AgrupLivres, TotalAgrup: DWord;
begin
Memo1.Clear;
if GetDiskFreeSpace(´C:\´, SetoresPorAgrup, BytesPorSetor, AgrupLivres, TotalAgrup) then with Memo1.Lines do begin
Add(´Setores por agrupamento: ´ + IntToStr(SetoresPorAgrup));
Add(´Bytes por setor: ´ + IntToStr(BytesPorSetor));
Add(´Agrupamentos livres: ´ + IntToStr(AgrupLivres));
Add(´Total de agrupamentos: ´ + IntToStr(TotalAgrup));
Add(´----- Resumo -----´);
Add(´Total de bytes: ´ + IntToStr(TotalAgrup * SetoresPorAgrup * BytesPorSetor));
Add(´Bytes livres: ´ + IntToStr(AgrupLivres * SetoresPorAgrup * BytesPorSetor));
end; end;
begin
Memo1.Clear;
if GetDiskFreeSpace(´C:\´, SetoresPorAgrup, BytesPorSetor, AgrupLivres, TotalAgrup) then with Memo1.Lines do begin
Add(´Setores por agrupamento: ´ + IntToStr(SetoresPorAgrup));
Add(´Bytes por setor: ´ + IntToStr(BytesPorSetor));
Add(´Agrupamentos livres: ´ + IntToStr(AgrupLivres));
Add(´Total de agrupamentos: ´ + IntToStr(TotalAgrup));
Add(´----- Resumo -----´);
Add(´Total de bytes: ´ + IntToStr(TotalAgrup * SetoresPorAgrup * BytesPorSetor));
Add(´Bytes livres: ´ + IntToStr(AgrupLivres * SetoresPorAgrup * BytesPorSetor));
end; end;
GOSTEI 0