IdFTP.Connect
![]() |
Наши проекты:
Журнал · Discuz!ML · Wiki · DRKB · Помощь проекту |
|
| ПРАВИЛА | FAQ | Помощь | Поиск | Участники | Календарь | Избранное | RSS |
| [216.73.217.37] |
|
|
Соблюдайте общие правила форума
MSDN Library
FAQ раздела
Поиск по разделу
Как правильно задавать вопросы
IdFTP.Connect
|
Сообщ.
#1
,
|
|
|
|
Код подключения к ФТП-серверу(из симпла к Indy9):
![]() ![]() procedure TMainForm.ConnectButtonClick(Sender: TObject); begin ConnectButton.Enabled := false; if IdFTP1.Connected then try if TransferrignData then IdFTP1.Abort; IdFTP1.Quit; finally CurrentDirEdit.Text := '/'; DirectoryListBox.Items.Clear; SetFunctionButtons(false); ConnectButton.Caption := 'Connect'; ConnectButton.Enabled := true; ConnectButton.Default := true; end else with IdFTP1 do try Username := UserIDEdit.Text; Password := PasswordEdit.Text; Host := FtpServerEdit.Text; Connect; //<-exception Self.ChageDir(CurrentDirEdit.Text); SetFunctionButtons(true); SaveFTPHostInfo(FtpServerEdit.Text, 'FTPHOST'); finally ConnectButton.Enabled := true; if Connected then begin ConnectButton.Caption := 'Disconnect'; ConnectButton.Default := false; end; end; end; При попытке подключится, функция Соnnеct поднимает исключение:"List index out of bounds(1)". При этом тот же код в примере работает исправно. В чем соль? |