我写了一个ftp上传程序,但不知道怎么才能将ftp服务器上的目录和文件在窗体listview控件上显示出来,哪位做过ftp的请赐教,不胜感谢。
在线等。
在线等。
解决方案 »
- 关于Ftp的the system cannot find the file specified
- 请问如何设置BitBtn上的快捷键,如F1,F2,F3......F12 ???即按下F1就执行BitBtnClick事件
- 今天还上班,郁闷..., 散分!
- QuickReport横向打印问题,急!!!
- 求TMS Software系列的Delphi7控件,需要源码
- 如何取得默认打印机的纸张类型及其长宽
- 各位兄台,谁有DELPHI的所有类大全?大部分也行呀。谢了。
- 倾家荡产求解c/s型数据库编程4个问题。高手帮帮忙呀!急!急!急!
- 高手请接招!!!!
- delphi窗体控件的自动加入
- MYQQ,请大家帮我测一下,QQ:304593221,程序通过QQ发给你们
- 怎样循环访问数据库中的数据?
var
F: TWin32FindData;
Enum: HInternet;
R: Bool;
FileName: string;
FileSize: Int64;
Magic:integer;
item1:Tlistitem;
begin
Enum := nil;
with Lview2 do
try
Clear;
Update;
Enum := FtpFindFirstFile(FtpHandle, PChar(FRemotePath + '*.*'), F, 0, 255);
R := Enum <> nil;
item1:=Lview2.Items.Add();
item1.SubItems.Add('');
item1.SubItems.Add('');
item1.SubItems.Add('');
LvAdd('..',0,0,item1);
while R do
begin
FileName := F.cFileName;
if Filename<>'.' then
begin
item1:=Lview2.Items.Add();
item1.SubItems.Add('');
item1.SubItems.Add('');
item1.SubItems.Add('');
LvAdd(Filename,0,0,item1);
FileSize := (F.nFileSizeHigh shl 32) or (F.nFileSizeLow);
if F.dwFileAttributes and faDirectory = faDirectory then
begin
item1.ImageIndex:=1;
item1.SubItems.Strings[0]:='目录';//文件夹
item1.SubItems.Strings[1]:= '0';
end
else
begin
item1.ImageIndex:=0;
item1.SubItems.Strings[0]:='';//文件夹
item1.SubItems.Strings[1]:= FileSizeToString(FileSize);
item1.SubItems.Strings[2]:=
GetFileTypeDescription(FRemotePath + FileName, True);
end;
end;
R := InternetFindNextFile(Enum, @F);
end;
finally
InternetCloseHandle(Enum);
RemoteSort:=True;
end;
end;
use 语句中有
Wininet
你说的函数就在该单元