procedure TForm1.Button3Click(Sender: TObject);
Var
AttList: TStrings;
NameList: TStrings;
count: integer;
i: integer;
Att,Dir: String;
Begin
AttList := TStringList.Create;
NameList := TStringList.Create;
Dir := 'i:/Temp';
NMFTP1.ParseList:=true;
NMFTP1.Vendor:=NMOS_AUTO;
NMFTP1.List;
AttList.Assign(NMFTP1.FTPDirectoryList.Attribute);
NameList.Assign(NMFTP1.FTPDirectoryList.name);
Memo1.Lines.Assign(NMFTP1.FTPDirectoryList.name);
count := AttList.Count;
Try
mkdir(dir);
Except
End;
Chdir(dir);
If count = 0 Then
exit;
For i := 0 To count - 1 Do
Begin
Att := AttList.Strings;
If (Att[1] = '-') Then
Begin
Try
NMFTP1.Download(nameList.Strings, dir + '/' + NameList.Strings);
Except
End;
End;
If (Att[1] = 'd') Then
Begin
mkdir(NameList.strings);
Try
NMFTP1.ChangeDir(NameList.strings);
Except
End;
DownLoadDirectory(dir + '/' + NameList.Strings, NMFTP1);
chdir(dir);
Try
NMFTP1.ChangeDir('..');
Except
End;
End;
End;
End;
procedure TForm1.Button4Click(Sender: TObject);
begin
Screen.Cursor := crHourGlass;
NMFTP1.ParseList:=true;
NMFTP1.Vendor:=NMOS_AUTO;
NMFTP1.List;
Memo1.Lines.Assign(NMFTP1.FTPDirectoryList.name);
Screen.Cursor := crDefault;
end;