判断文件目录名称是否存在
function TUPfileFRM.FtpDirectoryExists(ADir: string): Boolean;
var
index:Integer;
begin
Index:=0;
Result := false;
try
if Assigned(dllUPfileFRM.IdFtp1.DirectoryListing) and (dllUPfileFRM.IdFtp1.DirectoryListing.Count>0) then
while Index<dllUPfileFRM.IdFtp1.DirectoryListing.Count do
begin
with dllUPfileFRM.IdFtp1.DirectoryListing.Items[Index] do
begin
if (trim(FileName)=trim(ADir)) and (ItemType = ditDirectory) then 是文件夹类型 编译不通过时要USES IDFTPLIST
begin
Result:=true;
Exit;
end;
end;
Index:=Index+1;
end;
except
Result := False;
end;
end;
调用判断函数的功能:
function TUPfileFRM.Dllupfiles(ASourceFile,ADestFile,sAir:string):boolean;
var<