ics ftp 列目录

if ftpclnt1.Connected then

  begin

    stm := TMemoryStream.Create;

    mylist := TStringList.Create;

    try

      ftpclnt1.LocalStream := stm;

      if ftpclnt1.Dir then  // 列目录命令

      begin

        setlength(buffer, stm.size);

        stm.Seek(0, soFromBeginning);

        stm.Read(buffer[1], stm.size);

        mylist.Text := buffer;

        for ItemCount := 0 to mylist.Count - 1 do

        begin

          ParseList(mylist[ItemCount]);

        end;

      end;

    finally

      ftpclnt1.LocalStream := nil;

      stm.Free;

      mylist.Free;

    end;

  end


你可能感兴趣的:(ics ftp 列目录)