我的代码如下:
AFTP.ChangeDir(ADirectory);
aftp.DirectoryListing.Create;
AFTP.TransferType := ftASCII;
AFTP.List(nil); aftp.DirectoryListing.ListFormat:=flfUnix;
dirlist.ListFormat := aftp.DirectoryListing.ListFormat;
DirList := AFTP.DirectoryListing;为什么在运行到DirList := AFTP.DirectoryListing;这一句的时候报错:exception class EIDInvalidFTPListingFormat with message:Unknown FTP listing format求高手解答.
AFTP.ChangeDir(ADirectory);
aftp.DirectoryListing.Create;
AFTP.TransferType := ftASCII;
AFTP.List(nil); aftp.DirectoryListing.ListFormat:=flfUnix;
dirlist.ListFormat := aftp.DirectoryListing.ListFormat;
DirList := AFTP.DirectoryListing;为什么在运行到DirList := AFTP.DirectoryListing;这一句的时候报错:exception class EIDInvalidFTPListingFormat with message:Unknown FTP listing format求高手解答.
解决方案 »
- 郁闷呐,,为什么getprinter得到的打印机的状态都是0啊。。。
- 为什么连接远程数据库时失败?
- 有关GetProcessWorkingSetSize函数的问题?用过DWORD类型的可以进来看看。。。
- 求救啊!ValueListEditor控件怎么用啊
- 一个程序员的命运是否能够改变,就看各位了(急)
- 为什么有些控件安装之后,Find declaration 找不到定义那?
- 我做了個物料管理系統,應怎樣推行.應注意什么?QQ 172247218
- 从表怎么刷新?
- 关于模糊查询
- 如何得到scrollbar的横竖那个移动滑块的移动距离!!请求各位大侠告诉我答案!!
- 程序连接服务器出现的奇怪问题
- 请问如何用Socket组件传送点坐标
procedure TForm1.FTPDirToTreeView(AFTP: TIdFTP; ATree: TTreeView;
const ADirectory: String; AItem: TTreeNode;
AIncludeFiles:Boolean);
var
TempItem: TTreeNode;
I: Integer;
DirList: TIdFTPListItems;
DirItem: TIdFTPListItem;
LS: TStringList;
begin
LS := TStringList.Create;
DirList:= TIdFTPListItems.Create;
try
LS.Sorted := True;
ATree.Items.BeginUpdate;
try
if (ADirectory <> '') then
AFTP.ChangeDir(ADirectory);
AFTP.TransferType := ftASCII;
AFTP.List(nil);
showmessage(aftp.DirectoryListing.Items[0].Text);
DirList := AFTP.DirectoryListing;
for i := 0 to DirList.Count - 1 do
begin
try
DirItem := DirList.Items[i];
if (DirItem.ItemType = ditDirectory) then
begin
TempItem := ATree.Items.AddChild(AItem, Trim(DirItem.FileName)+ '/');
LS.AddObject(Trim(DirItem.FileName), TempItem);
end
else
begin
if (AIncludeFiles) then
ATree.Items.AddChild(AItem, DirItem.FileName);
end;
except
end;
end; for i := 0 to LS.Count - 1 do
begin
FTPDirToTreeView(AFTP, ATree, ADirectory +
LS.Strings[i] + '/', TTreeNode(LS.Objects[i]), AIncludeFiles);
end;
finally
ATree.Items.EndUpdate;
end;
finally
LS.Free;
end;
end;