赛
赛特
Unregistered / Unconfirmed
GUEST, unregistred user!
IdFTPServer所有属性都为默认值;
procedure TForm1.IdFTPServer1ListDirectory(ASender: TIdFTPServerContext;
const APath: string;
ADirectoryListing: TIdFTPListOutput;
const ACmd,
ASwitches: string);
var
LFTPItem :TIdFTPListItem;
SR : TSearchRec;
SRI : Integer;
begin
ADirectoryListing.DirFormat :=do
Unix;
SRI := FindFirst(ReplaceChars(AppDir + APath + '/*.*'), faAnyFile, SR);
While SRI = 0do
begin
LFTPItem := ADirectoryListing.Add;
LFTPItem.FileName := SR.Name;
LFTPItem.ModifiedDate := FileDateToDateTime(SR.Time);
if SR.Attr = faDirectory then
begin
LFTPItem.ItemType := ditDirectory;
LFTPItem.Size := 0;
end
else
begin
LFTPItem.ItemType := ditFile;
LFTPItem.Size := SR.Size;
end;
SRI := FindNext(SR);
end;
FindClose(SR);
end;
此时ADirectoryListing.Count已经包含有 '.' 和 '..' 两个文件,但为什么IdFTP1端的IdFTP1.DirectoryListing.Count总是少2个,具体把文件显示出来发现就是少了 '.' 和 '..' 两个文件,如何才能让这两个文件显示出来呢?
ADirectoryListing.DirFormat :=do
Unix;这句有什么作用呢?
非常感谢!!
procedure TForm1.IdFTPServer1ListDirectory(ASender: TIdFTPServerContext;
const APath: string;
ADirectoryListing: TIdFTPListOutput;
const ACmd,
ASwitches: string);
var
LFTPItem :TIdFTPListItem;
SR : TSearchRec;
SRI : Integer;
begin
ADirectoryListing.DirFormat :=do
Unix;
SRI := FindFirst(ReplaceChars(AppDir + APath + '/*.*'), faAnyFile, SR);
While SRI = 0do
begin
LFTPItem := ADirectoryListing.Add;
LFTPItem.FileName := SR.Name;
LFTPItem.ModifiedDate := FileDateToDateTime(SR.Time);
if SR.Attr = faDirectory then
begin
LFTPItem.ItemType := ditDirectory;
LFTPItem.Size := 0;
end
else
begin
LFTPItem.ItemType := ditFile;
LFTPItem.Size := SR.Size;
end;
SRI := FindNext(SR);
end;
FindClose(SR);
end;
此时ADirectoryListing.Count已经包含有 '.' 和 '..' 两个文件,但为什么IdFTP1端的IdFTP1.DirectoryListing.Count总是少2个,具体把文件显示出来发现就是少了 '.' 和 '..' 两个文件,如何才能让这两个文件显示出来呢?
ADirectoryListing.DirFormat :=do
Unix;这句有什么作用呢?
非常感谢!!