With the continuous popularization of broadband, their own do-it-yourself website friends also more. Homepage completed, of course, to choose the right free space, with the FTP software upload. In this respect, there are many options for uploading software. So have you ever thought of doing it yourself? In fact, with Delphi can be very convenient to complete the work. Let ' s go!
Interface design
First, add NMFTP1, Edit, Opendialog1, Meno1, label, and so on, put the following figure.
Control code
1. "Connection" code:
procedure TForm1.Button2Click(Sender: TObject);
begin
nmftp1.Host :=edit3.Text ;
nmftp1.UserID :=edit1.text;
nmftp1.Password :=edit2.text;
nmftp1.Connect ;
end;
2. "Upload" code:
procedure TForm1.Button5Click(Sender: TObject);
var s:string;
begin
s:=label5.caption;
nmftp1.Upload('s',null);
3. "Abort" code:
procedure TForm1.Button4Click(Sender: TObject);
begin
NMFTP1.Abort ;
end;