16,748
社区成员
发帖
与我相关
我的任务
分享
implementation{$R *.dfm}
var
pathstr:PChar;
fddata:TWin32FindData;
hd:THANDLE;
br:Bool;
EC:DWORD=0;
procedure TForm1.Button1Click(Sender: TObject);
begin
pathstr:='c:\windows\system32\*.dll';
hd:=FindFirstFile(pathstr,fddata);
while ( (hd<>INVALID_HANDLE_VALUE) and (EC<>ERROR_NO_MORE_FILES) ) do
begin
if ( fddata.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY )then
//if ((string(fddata.cFileName)<>'.') and (string(fddata.cFileName)<>'..')) then
begin strcat() ...end;
begin
//never used
br:=FindNextFile(hd,fddata);
EC:=GetLastError();
end
else
begin
Listbox1.Items.Add(string(fddata.cFileName));
br:=FindNextFile(hd,fddata);
EC:=GetLastError();
end;
end;
windows.FindClose(hd);
end;
end.