Autor Beitrag
Hack Gott
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 409

Windows Vista
Delphi 2005 Personal, Delphi 7
BeitragVerfasst: Mi 26.01.05 17:03 
:? Ich hab das Problem das ich mit delphi eine datei auf einen ftp server schreiben will. dazu will ich eigentlich ein memo benutzen. aber das klappt leider nicht mit lines.savetofile. ich hoffe ihr könnt mir helfen. :?:
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mi 26.01.05 17:13 
Also du möchtest auf einen bestimmten FTP-Server ftp.XXXXX.com eine Textdatei hochladen, die zuvor in einem Memo in deinem Prog steht, ja??

Hast du dir schonmal die Indy-Komponenten angesehen?? :D

//EDIT: Ach ja, Infos zu denen gibbet da: www.indyproject.org.... :wink:

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.
Harry M.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754

Win 2000, XP
D2005
BeitragVerfasst: Mi 02.02.05 03:05 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
//........
Memo1.Lines.SaveToFile('File.Name'); // datei speichern
IdFTP1.Connect(TRUE,5000);            // coonecten
if IdFTP1.Connected = TRUE then IdFtp1.Put('File.Name', 'File.Name', TRUE); // hochladen
IdFTP1.Disconnect; // trennen
//..........


Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
Sprint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 849



BeitragVerfasst: Mi 02.02.05 06:19 
Hack Gott hat folgendes geschrieben:
dazu will ich eigentlich ein memo benutzen. aber das klappt leider nicht mit lines.savetofile.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
procedure TForm1.Button1Click(Sender: TObject);
var
  MemStream: TMemoryStream;
begin

  MemStream := TMemoryStream.Create;
  try
    Memo1.Lines.SaveToStream(MemStream);
    MemStream.Position := 0;
    with IdFTP1 do
    begin
      Host := 'ftp.MyFtpServer.de';
      Username := 'MyUsername';
      Password := 'MyPassword';
      Passive := True;
      TransferType := ftASCII;
      Connect(True, 3000);
      if Connected then
      begin
        Put(MemStream, 'MyFile.txt');
        Disconnect;
      end;
    end;
  finally
    MemStream.Free;
  end;

end;

_________________
Ciao, Sprint.
Hack Gott Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 409

Windows Vista
Delphi 2005 Personal, Delphi 7
BeitragVerfasst: Mi 02.02.05 13:41 
Titel: Es gibt keine überladene Option von 'Connect'?!
Ich erhalte die Meldung Es gibt keine überladene Option von 'Connect', die man mit diesen Argumenten aufrufen kann. zeigt mir delphi beim compilieren des programms an, wenn ich den folgenden Text in Delphi eingegeben habe:

ausblenden Delphi-Quelltext
1:
IdFTP1.Connect(TRUE,5000);					


Der Cursor springt dann zu der Zahl 5000.
Was kann ich dagegen tun?

_________________
"Je mehr Käse, desto mehr Löcher; Je mehr Löcher, desto weniger Käse. Daraus folgt: Je mehr Käse desto weniger Käse!"
Hack Gott Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 409

Windows Vista
Delphi 2005 Personal, Delphi 7
BeitragVerfasst: Mi 02.02.05 13:47 
Titel: Sorry
Es klappt wenn ich die Klammer lösche, danke für den guten Tipp, aber wie lade ich die Dateien wieder runter?

_________________
"Je mehr Käse, desto mehr Löcher; Je mehr Löcher, desto weniger Käse. Daraus folgt: Je mehr Käse desto weniger Käse!"
Hack Gott Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 409

Windows Vista
Delphi 2005 Personal, Delphi 7
BeitragVerfasst: Mi 02.02.05 13:56 
Titel: Löschen
Ach ja wenn wir schon dabei sind.
Ich brauch noch den Befehl zum Löschen und umbennnenen, der zum Verschieben wer auch noch praktisch. Außerdem, wie vorhin schon gennant zum Downloaden von Dateien in eine Memo.

_________________
"Je mehr Käse, desto mehr Löcher; Je mehr Löcher, desto weniger Käse. Daraus folgt: Je mehr Käse desto weniger Käse!"
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Mi 02.02.05 14:50 
wie wärs wenn du die online hilfe oder die autocode vervollständigung versuchst? versuch mal delete.. runterladen: get ... alles selba ausprobieren :D dadurch lerste wohl am meisten :D

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.