【发布时间】:2012-06-20 19:16:26
【问题描述】:
我正在尝试在我的网络空间中上传一个文件 .txt,但是问题开始了,我尝试的代码是这样的:
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdExplicitTLSClientServerBase, IdFTP, StdCtrls;
procedure TForm1.Button1Click(Sender: TObject);
var
FTP:tidftp;
begin
FTP.Host:='website.altervista.org';
FTP.Username:='website';
FTP.Password:='password';
FTP.Port:=25;
FTP.Connect;
FTP.Put('C:\Users\user\Desktop\text.txt');
FTP.Quit;
end;
我没有收到任何错误,但是当我启动程序并单击按钮时,我收到错误:
紧接着:
按钮消失。
为什么?谢谢!
【问题讨论】:
-
也许想阅读一些有关 delphi 语言的文档。