美
美国提子
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.FindAll(const Path: String);
var
sr:TSearchRec;
fr:Integer;
f: File;
begin
fr:=FindFirst(Path,faAnyFile,sr);
while fr=0 do
begin
if (sr.Attr=faDirectory)and(sr.Name<>'.')and(sr.Name<>'..') then
FindAll(sr.Name)
else begin
if Pos('.',sr.Name) = 0 then//到不了这一步啊
begin
AssignFile(f,sr.Name);
ReName(f,sr.Name+'.txt');
end;
end;
FindNext(sr);
end;
FindClose(sr);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
PathStr: String;
begin
PathStr := DLB.Directory;//DLB是TDirectoryListBox
FindAll(PathStr);
end;
上面好像不行啊,一运行就死机
var
sr:TSearchRec;
fr:Integer;
f: File;
begin
fr:=FindFirst(Path,faAnyFile,sr);
while fr=0 do
begin
if (sr.Attr=faDirectory)and(sr.Name<>'.')and(sr.Name<>'..') then
FindAll(sr.Name)
else begin
if Pos('.',sr.Name) = 0 then//到不了这一步啊
begin
AssignFile(f,sr.Name);
ReName(f,sr.Name+'.txt');
end;
end;
FindNext(sr);
end;
FindClose(sr);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
PathStr: String;
begin
PathStr := DLB.Directory;//DLB是TDirectoryListBox
FindAll(PathStr);
end;
上面好像不行啊,一运行就死机