只能说是给你参考一下。
fadodm.FtpClient1.Timeout := 60; // default is 15
fadodm.FtpClient1.HostName := IPAddress;
fadodm.FtpClient1.Port := Port;
fadodm.FtpClient1.UserName := UserName;
fadodm.FtpClient1.Password := PassWord;
fadodm.FtpClient1.DisplayFileFlag := TRUE;
fadodm.FtpClient1.LocalFileName := LocaFilename;
fadodm.FtpClient1.HostDirName := HostPath;
fadodm.FtpClient1.HostFileName := HostFileName;
if not fadodm.FtpClient1.Connect then begin
Response.Write('连接失败!');
fadodm.FtpClient1.Abort;
Exit;
end
else
Response.Write('连接成功!');
Response.Write('<BR>');
Response.Write('正在上传');
Response.Write('<BR>');
sleep(1500);
if not fadodm.FtpClient1.Put then begin
Response.Write('上传失败!');
fadodm.FtpClient1.Abort;
Exit;
end
else
Response.Write('上传成功!');
Response.Write('<BR>');
if not fadodm.FtpClient1.Quit then begin
Response.Write('断开失败!');
fadodm.FtpClient1.Abort;
Exit;
end
else
Response.Write('成功断开!');
Response.Write('<BR>');
Response.Write('所有操作成功完成.');