Autor Beitrag
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 09.10.05 14:23 
Servus!

Hab mal eine kleine Frage bezüglich de, Senden von Daten per Inet ohne Indy o.ä. Ich habe ein kleines Programm, das sich einen Code aus einer Textdatei, die auf einem Server liegt, holt, anschließend den Code als Dateinamen interpretiert und eine Textdatei vom gleichen Server lädt. Die wird dann ausgedruckt. Klappt alles wunderbar (mit folgendem Code)

ausblenden volle Höhe 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:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
var
  Form1: TForm1;
  code: String = '';

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  ComboBox1.Items := Printer.Printers;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  URLDownloadToFile(nil, PChar(Edit1.Text + 'code.txt'), 'C:\code.txt'0nil);
  RichEdit1.Lines.LoadFromFile('C:\code.txt');
  code := RichEdit1.Text;
  URLDownloadToFile(nil, PChar(Edit1.Text + code + '.txt'), 'C:\bla.txt'0nil);
  RichEdit1.Lines.LoadFromFile('C:\bla.txt');
  if Length(RichEdit1.Text) = 0 then
    RichEdit1.Print('Drucktimer ' + code);
  //Rückgabe?
end;

procedure TForm1.ComboBox1Change(Sender: TObject);
begin
  Printer.PrinterIndex := ComboBox1.ItemIndex;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  try
    Timer1.Interval := StrToInt(Edit2.Text) * 1000;
  except
    MessageDlg('Ungültiger Zahlenwert.', mtError, [mbOK], 0);
    end;
end;


(ja, ich weiß: quick&dirty...)

Eigentliches Problem: die hervorgehobene Stelle. Wie kann ich die eben gedruckte ID (Variable code) an den Server zurücksenden? Vorstellbar wäre das am einfachsten mit einem Aufruf wie www.bla.blub/muh.php?id=code o.ä. Nur wie stell ich das am einfachsten an?

AXMD
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: So 09.10.05 14:32 
wieder mit urldownloadtofile ?

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
AXMD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 09.10.05 14:33 
Wie soll das gehen :shock:

AXMD
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: So 09.10.05 14:35 
ausblenden Delphi-Quelltext
1:
urldownloadtofile(nil' www.bla.blub/muh.php?id=code'nil0nil);					

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
AXMD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 09.10.05 14:39 
So einfach :shock: Kann ich mir gar nicht vorstellen :lol: Ich denk schon wieder so kompliziert ^^. Danke :)

AXMD
AXMD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 09.10.05 16:20 
Mist... funktioniert doch nicht :gruebel:. Andere Vorschläge?

AXMD
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: So 09.10.05 17:11 
ausblenden Delphi-Quelltext
1:
urldownloadtofile(nil'http://www.bla.blub/muh.php?id=code''C:\temp.txt'0nil);					

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
AXMD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 09.10.05 17:15 
Ok, das haut hin. Nur warum geht's ohne den einen Parameter nicht :gruebel:

AXMD
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: So 09.10.05 18:51 
downloadtofile macht nicht viel sinn ohne file ;)

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...