Delphi FTP Component

Bekmez
23-04-2006, 03:33   |  #1  
OP Taze Üye
Teşekkür Sayısı: 0
5 mesaj
Kayıt Tarihi:Kayıt: Nis 2004

 

Umarim yardimci olmusumdur.

uses : Wininet

var
  Form1: TForm1;
   intconn,intopen: hinternet;
  Host: String;
  User: String;
  Pass: String;


procedure UploadMyFile (File2Upload:pchar; targetfilename:pchar);
const
TheFtpPort = 21;
begin
intopen := internetopen('iexplore',INTERNET_OPEN_TYPE_DIRECT,nil,nil,0);
intconn := internetconnect(intopen, PChar(Host),TheFtpPort,PChar(User),PChar(Pass),INTERNET_SERVICE_FTP,INTERNET_FLAG_PASSIVE,0);
sleep(100);
ftpputfile(intconn,File2Upload,targetfilename,FTP_TRANSFER_TYPE_UNKNOWN,0);
internetclosehandle(intconn);
internetclosehandle(intopen);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
uploadmyfile('önemliler.txt', 'intex.html');
end;

end.

formcreate ye

  Host := Edit1.Text;
  User := Edit2.Text;
  Pass := Edit3.Text;