M
meiguibao
Unregistered / Unconfirmed
GUEST, unregistred user!
Function PutFile(host:string;remotefile:string;localfile:string;username:string;pwd:string):integer;
var
cSourFile : String;
lResult : integer;
MyFtp : TIdFTP;
begin
lResult := 1;
cSourFile := 'D:/ftp/ftp.txt';
MyFtp := TIdFTP.Create(self); ///////出错的地方 [Error] MyFtp.dpr(18): Undeclared identifier: 'self'
MyFtp.Host := '192.168.168.201';
MyFtp.User := 'ftpuser';
MyFtp.Password := 'ftp';
try
MyFtp.Connect();
MyFtp.Put(cSourFile,'ftp.txt',False);
except
lResult := 0;
end;
MyFtp.Abort;
MyFtp.Quit;
Result := lResult;
end;
var
cSourFile : String;
lResult : integer;
MyFtp : TIdFTP;
begin
lResult := 1;
cSourFile := 'D:/ftp/ftp.txt';
MyFtp := TIdFTP.Create(self); ///////出错的地方 [Error] MyFtp.dpr(18): Undeclared identifier: 'self'
MyFtp.Host := '192.168.168.201';
MyFtp.User := 'ftpuser';
MyFtp.Password := 'ftp';
try
MyFtp.Connect();
MyFtp.Put(cSourFile,'ftp.txt',False);
except
lResult := 0;
end;
MyFtp.Abort;
MyFtp.Quit;
Result := lResult;
end;