📄 unit1.pas
字号:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, FileCtrl;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
DriveComboBox1: TDriveComboBox;
DirectoryListBox1: TDirectoryListBox;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
dir:string;
n:integer;
procedure scan(dir:string);
implementation
{$R *.dfm}
procedure scan(dir:String);
var sc:TSearchRec;
find:integer;
begin
find:=findfirst(dir+'*.*',faAnyFile,sc);
while find=0 do
begin
if ((sc.Attr and faDirectory)=faDirectory)and((sc.Name='.')or(sc.Name='..')) then
begin
find:=findnext(sc);
continue;
end;
if ((sc.Attr and faDirectory)=faDirectory) then
begin
Form1.Memo1.Lines.Add(' ');
Form1.Memo1.Lines.Add(' '+sc.Name+':');
Form1.Memo1.Lines.Add(' - - - - - - - - - - - - - - - - - - - - -');
scan(dir+sc.Name+'\');
find:=findnext(sc);
continue;
end;
Form1.Memo1.Lines.Add(' '+sc.Name);
n:=n+1;
find:=findnext(sc);
end;
findclose(sc);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
n:=0;
Form1.Memo1.Clear;
Form1.Label2.Caption:='';
Form1.Edit1.Text:=Form1.DirectoryListBox1.Directory+'\';
scan(Form1.DirectoryListBox1.Directory+'\');
Form1.Label2.Caption:='袜殇屙
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -