unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdExplicitTLSClientServerBase, IdFTP, StdCtrls;
type
TForm1 =
class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
IdFTP1: TidFTP;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses
// Unit einbinden
uSpecialFolders;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var sl:TStrings;
begin
// Temporäres Verzeichnis für diese App erstellen
if
ForceDirectories( ResolveSFVars( '
{appdatatemp}' ) )
then
begin
sl := TStringList.Create;
try
sl.Add(Edit1.text);
sl.Add(Edit2.text);
sl.SaveToFile( ResolveSFVars( '
{appdatatemp}\text.txt' ) );
finally
sl.Free;
end;
with IdFTP1
do
begin
Host :='
kidgudi.ki.funpic.de';
Username := '
kidgudi';
Password := '
*****';
Passive := true;
Connect;
Put( ResolveSFVars( '
{appdatatemp}\text.txt' ), '
text.txt', true);
Disconnect;
end;
// Temporäres Verzeichnis aufräumen und löschen
DeleteAndEmptyDir( '
{appdatatemp}' );
end
else
ShowMessage( '
Temporäres Verzeichnis konnte nicht erstellt werden!' );
end;
end.