this slowpoke moves

Get Folder size in Byte

uses ComObj

//

function FolderSize(FolderName: string): Int64;
var
  fldr, fso: OleVariant;
begin
  fso := CreateOleObject('Scripting.FileSystemObject');
  fldr := fso.GetFolder(FolderName);

  result := fldr.size;
end;
Beispiel :
procedure TForm1.Button1Click(Sender: TObject);
begin
  Label1.Caption := IntToStr(FolderSize(Edit1.Text)) + ' Byte';
end;

Keine Kommentare:

Kommentar veröffentlichen

Beliebte Posts

Translate