home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
delphi
/
tenpack.lzh
/
INFODEMO.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-06-19
|
2KB
|
63 lines
unit infodemo;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, psfinfo, StdCtrls, Buttons, FileCtrl;
type
TDemoFileInfo = class(TForm)
DriveComboBox1: TDriveComboBox;
DirectoryListBox1: TDirectoryListBox;
Label1: TLabel;
BitBtn1: TBitBtn;
Fileinfo1: TFileinfo;
Memo1: TMemo;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
DemoFileInfo: TDemoFileInfo;
implementation
{$R *.DFM}
procedure TDemoFileInfo.BitBtn1Click(Sender: TObject);
var
msg : string;
begin
memo1.clear;
Fileinfo1.path := directorylistbox1.directory;
msg := 'Drive '+Copy(drivecombobox1.text,1,2);
msg := Msg + ' has ' + FloatToStrF(Fileinfo1.numTopLevelDirs,ffnumber,12,0);
msg := Msg + ' Top level directories. ';
Memo1.lines.add(msg);
msg := '';
msg := msg + 'Path ' + directorylistbox1.directory;
msg := msg + ' has ' + FloattoStrf(Fileinfo1.Numfiles,ffnumber,12,0);
msg := msg + ' files occupying ';
msg := msg + Floattostrf(Fileinfo1.Filebytes,ffnumber,12,0)+' bytes of disk space.';
Memo1.lines.add(msg);
msg := '';
Msg := msg + 'The directory tree beginning at ' + directorylistbox1.directory;
msg := msg + ' has ' + Floattostrf(Fileinfo1.Numdirsbeneath,ffnumber,12,0)+' subdirectories.';
Memo1.lines.add(msg);
msg := '';
msg := msg + 'This directory tree has ' + Floattostrf(Fileinfo1.numfilesbeneath,ffnumber,12,0) + ' files occupying ';
msg := msg + Floattostrf(Fileinfo1.filebytesbeneath,ffnumber,12,0) + ' bytes of disk space.';
Memo1.lines.add(msg);
msg := '';
msg := msg + 'This size of drive ' + copy(drivecombobox1.text,1,2) + ' is ';
msg := msg + Floattostrf(Fileinfo1.Thisdisksize,ffnumber,12,0) + ' bytes.';
memo1.lines.add(msg);
memo1.visible := true;
end;
end.