最近用Indy的FTPServer编写FTP服务器,发现不能正常LIST文件列表,客户端用CuteFtp,而用一使用API写的客户端正常,上传文件的话,文件存放的地址也正确。????????不懂,难道是OnListDirectory的问题????各位老大给点建议,或给点源代码参考一下。
解决方案 »
- 请问如何在Delphi中调用Access的Report
- 求职广州
- 请问如何给dataModule中的adoConnection赋值?
- rave 中画表格的问题?
- 求助: 打印ADOQuery结果时出了点问题
- 怎样让DBGRID里部分字段不接受焦点?
- Delphi程序下如何获得显卡的overlay的显示模式?
- 请问如何把Delphi的Debug信息屏蔽掉,即在编译期间不显示?
- Delphi菜鸟求指教,关于ocx
- 上海有delphi6了,哈哈.......特来一起分享!!
- 想到了一个好主意:申请了一个163的大邮箱(1500M),供大家一起用来共享。
- 简单的RzProgressBar1问题,在线等!!
AFolder: string);
var
w32fd: TWin32FindData;
h: THandle;
lTime: TFileTime;
sTime: TSystemTime;
begin
if not DirectoryExists(AFolder) then Exit;
if AFolder[Length(AFolder)] = '\'
then AFolder := AFolder + '*.*'
else AFolder := AFolder + '\*.*';
h := Windows.FindFirstFile(PChar(AFolder), w32fd);
while h <> INVALID_HANDLE_VALUE do
begin
with ADirectoryListing.Add, w32fd do
begin
FileName := ExtractFileName(cFileName);
if (dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = 0
then ItemType := ditFile
else ItemType := ditDirectory;
Size := nFileSizeHigh * MAXDWORD + nFileSizeLow;
FileTimeToLocalFileTime(ftCreationTime, lTime);
if FileTimeToSystemTime(lTime, sTime)
then ModifiedDate := EncodeDate(sTime.wYear, sTime.wMonth, sTime.wDay) + EncodeTime(sTime.wHour, sTime.wMinute, sTime.wSecond, sTime.wMilliSeconds)
else ModifiedDate := Now;
GroupName := vft_FTP;
OwnerName := vft_FTP;
UserPermissions := 'rw-';
GroupPermissions := 'rw-';
OwnerPermissions := 'rw-';
end;
if not Windows.FindNextFile(h, w32fd) then Break;
end;
Windows.FindClose(h);
end;在List事件处理:AddFTPFileList(ADirectoryListing, ConvertFTPPathToLocalPath(APath, false));上面的只是方法,自己分析一下吧http://lysoft.7u7.net
能否给一下ConvertFTPPathToLocalPath(APath, false)的代码?设置Homedir和CurrentDir按FTP目录结构还是按WINDOWS目录结构方式。先谢了!!!!