//判断path下是否有文件夹(allowfileview为真时还判断文件)
//path结尾后不要有'/'
function IsNull(Path:string;AllowFileView:boolean):boolean;
var
srec:tsearchrec;
i:integer;
found:boolean;
begin
result:=true;
i:=findfirst(path+'/*.*',faanyfile,srec);
while i=0 do
begin
If (SRec.Attr and faDirectory)<> 0 Then
If (SRec.Name <> '.') and (SRec.Name <> '..') Then
begin
result:=false;
break;
end;
if AllowFileView then begin
If (SRec.Attr and faAnyFile)<>0 Then
begin
result:=false;
break;
end;
end;
i:=findnext(srec);
end;
findclose(srec);
end;
//得到p路径下的文件列表,path结尾后不要有'/'
//Result.count就是文件个数;
function getfile(p:string):Tstringlist;
var
list:tstringlist;
srec:tsearchrec;
i:integer;
begin
list:=tstringlist.Create;
i:=findfirst(p+'/*.*',faanyfile,srec);
while i=0 do
begin
If (SRec.Attr and (faDirectory or faVolumeID)) = 0 Then
list.Add(srec.name);
i:=findnext(srec);
end;
findclose(srec);
result:=list;
end;