N
ngdsjck
Unregistered / Unconfirmed
GUEST, unregistred user!
我写了如下代码:
var
i:integer;
item,item1:Tlistitem;
ls:Tstrings;
begin
idftp1.Host :='131.43.128.4';
idftp1.Username:='admin';
idftp1.Password :='12714001';
idftp1.Connect;
// idftp1.ChangeDir('银行接收');
try
ls:=tstringlist.Create;
IdFTP1.TransferType := ftASCII;
ed_rfilename.Text:=idftp1.RetrieveCurrentDir;;
idftp1.List(ls);
i:=idftp1.DirectoryListing.Count;
label1.Caption:=inttostr(i);
finally
ls.Free;
end;
end;
这是从内部FTP上取目录和文件数据,但是怎么执行,i的值为0,请问该如何处理?
var
i:integer;
item,item1:Tlistitem;
ls:Tstrings;
begin
idftp1.Host :='131.43.128.4';
idftp1.Username:='admin';
idftp1.Password :='12714001';
idftp1.Connect;
// idftp1.ChangeDir('银行接收');
try
ls:=tstringlist.Create;
IdFTP1.TransferType := ftASCII;
ed_rfilename.Text:=idftp1.RetrieveCurrentDir;;
idftp1.List(ls);
i:=idftp1.DirectoryListing.Count;
label1.Caption:=inttostr(i);
finally
ls.Free;
end;
end;
这是从内部FTP上取目录和文件数据,但是怎么执行,i的值为0,请问该如何处理?