问:如何遍例一个文件夹下的所有子文件夹
解决方案 »
- 控件制作工具
- 关于报表的备注和显示内容如何放置的问题请教
- 菜鸟问题!!!!!!我的DELPHI7中没有DBchart和chart,不知道如何才能找回。
- 怎样用一进度条来表示对数据表的查询过程.
- 如何读取xml
- oracle数据库出错了,大侠们救命!
- 谁知道用DELPHI怎么连接。MDB文件啊,请讲详细点,我很菜啊,谢谢,急用!!!!!!
- 字段A20(是D日期型),怎样才能得到如VFP中的year(a20)=2002的SQL语句?
- string类型转换成pchar类型时出错
- 请教高手dephi中sql问题
- 谁有《Object Pascal 编程指南 》书?在线等待!
- 用程序选择Treeview的一个item节点后,如何用程序将该节点显为高亮,又如何撤消高亮?
var
SR : TSearchRec;
dirlist:Tstringlist;
tmp:string;
dt:tdatetime;
begin
dirlist:=Tstringlist.Create;
if path[length(path)]<>'\' then path:=path+'\';
If FindFirst(path+searchname,faAnyFile,SR)=0then
Repeat
dirlist.Clear;
If (SR.Attr<>faDirectory) and (SR.Name[1]<>'.') then
begin
tmp:=path+sr.Name;
dirlist.Add(tmp);
tmp:=Format('%1.0n', [sr.Size+0.0]);
dirlist.Add(tmp);
dt := FileDateToDateTime(sr.Time);
tmp:=FormatDateTime('yyyy-mm-dd hh:nn ampm', dt);
dirlist.Add(tmp);
filelist.Add(dirlist.CommaText);
end;
Until (FindNext(SR)<>0);
FindClose(SR);
If FindFirst(path+'*.*',faAnyFile,SR)=0 then
begin
Repeat
if (sr.Name='.')or(sr.Name='..') then continue;
if (sr.Attr=faDirectory) then
searchfile(path+SR.Name+'\',SearchName);
Until (FindNext(SR)<>0);
end;
FindClose(SR);
Result := filelist.Text;
DirList.Free;
end;
varfpath: String;fs: TsearchRec;beginfpath:=disk+path+'\*.*';if findfirst(fpath,faAnyFile,fs)=0 thenbeginif (fs.Name<>'.')and(fs.Name<>'..') thenif (fs.Attr and faDirectory)=faDirectory thenfindall(disk,path+'\'+fs.Name,fileresult)elsefileresult.add(disk+strpas(strupper(pchar(path)))+'\'+strpas(strupper(pchar(fs.Name)))+'('+inttostr(fs.Size)+')');while findnext(fs)=0 dobeginif (fs.Name<>'.')and(fs.Name<>'..') thenif (fs.Attr and faDirectory)=faDirectory thenfindall(disk,path+'\'+fs.Name,fileresult)elsefileresult.add(disk+strpas(strupper(pchar(path)))+'\'+strpas(strupper(pchar(fs.Name)))+'('+inttostr(fs.Size)+')');end;end;findclose(fs);end;