我在抄写一个书上FTP 客户端的时候。有这样的一条代码
if ftp1.DirectoryListing.Items[filecount].ItemType = 'ditDirectory'
then
.........
报错说 [Error] Unit_main.pas(89): Incompatible types: 'String' and 'TIdDirItemType'
怎么办?
if ftp1.DirectoryListing.Items[filecount].ItemType = 'ditDirectory'
then
.........
报错说 [Error] Unit_main.pas(89): Incompatible types: 'String' and 'TIdDirItemType'
怎么办?
解决方案 »
- 使用RIchView如何设置行距和字距?
- 请教如何取得www.google.cn里的输入框值呢?谢谢,夜等高手
- 请教查询问题
- 混淆的概念,望高手解惑!!分不够,加!
- 如何隐藏任务栏上的图标啊 求救
- 请教,想实现一个多边形的函数,类似于POLYLINE函数,只不过我的多边形是每条边两条线,线的间距是5像素,请高手帮
- 欧洲杯 1/4决赛 英格兰VS葡萄牙,猜中200分!!
- QuickReport组中的报表控件QRRichEdit,怎样设置行距和字符间距?
- 高手请帮忙:如何使用nmsmtp控件发送带附件的HTML格式信件
- 请介绍一下用Oracle7(8)做数据库服务器,开发三层应用时,oracle的配置。
- 关于Edit控件的问题,大家帮分析一下是什么原因??
- 如何得到另一个应用程序窗口的状态信息:最大化,最小化,还是隐藏?
var
ls :Tstringlist;
filecount : integer;
newitem : Tlistitem;
foldercount : integer;begin
try
ls := Tstringlist.Create;
ftp1.ChangeDir(comboxremote.Text);
listvremote.Items.Clear;
ftp1.List(ls);
foldercount := 0 ;
for filecount := 0 to ls.Count -1 do
begin
if (ftp1.DirectoryListing.Items[filecount].ItemType = 'ditDirectory')
then
begin
newitem := listvremote.Items.Insert(foldercount);
newitem.ImageIndex := 0;
newitem.SubItems.Add('文件夹');
end
else
begin
newitem := listvremote.Items.Add;
newitem.SubItems.Add('');
end; newitem.Caption := ftp1.DirectoryListing.Items[filecount].FileName; newitem.SubItems.Add(inttostr(ftp1.DirectoryListing.Items[filecount].Size)); newitem.SubItems.Add(datetostr(ftp1.DirectoryListing.Items[filecount].ModifiedDate));
end;
finally
ls.Free;
end;end;