Autor Beitrag
NuCHiLL
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 37

WXP
D7E
BeitragVerfasst: Mi 21.04.04 13:11 
Halloo,
mit folgendem thread will ich (mit Indy) eine Datei runterladen, Delphi sagt aber

Zitat:
[Error] Threadx.pas(34): Undeclared identifier: 'Get'


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:
39:
40:
41:
42:
43:
44:
45:
unit Threadx;

interface

uses
  Classes, IdBaseComponent,
  IdComponent, IdTCPConnection, IdTCPClient, IdHTTP;

type
  nuc = class(TThread)
  private
    function DownloadWithIndy(woher, wohin: string): TFileStream;
  protected
    constructor Create(CreateSuspended: boolean);
    procedure Execute; override;
  end;

implementation

{ nuc }

constructor nuc.Create(CreateSuspended: boolean);
begin
  inherited Create(CreateSuspended);
  Priority := tpNormal;
  FreeOnTerminate := True;
end;

function DownloadWithIndy(woher, wohin: string): TFileStream;
var Datei: TFIleStream;
begin
  Datei:=TFileStream.create(wohin,fmCreate);
   try
    IdHttp.Get(woher,Datei);  // Fehlerteufel !
   finally
    Datei.free;
   end;
end;

procedure nuc.Execute;
begin
  DownloadWithIndy('http://domain.de/test.txt', 'c:\test.txt');
end;

end.


Jemand vllt ne Idee, was ich noch einfügen muss, damit "IdHttp.GET" funktioniert?

thx1

_________________
-I am what I am and I do what I can-
MAlsleben
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 303

W2k,WinXP
D3 - DXE3 Enterprise
BeitragVerfasst: Do 22.04.04 15:00 
Hi,

ich würde sagen, Du mußt erstmal mit TIdHttp.Create eine Instanz erzeugen, so wie Du es mit FileStream auch getan hast.

Gruß Micha.

_________________
Viele Wege führen nach Rom.
NuCHiLL Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 37

WXP
D7E
BeitragVerfasst: Fr 23.04.04 12:35 
hab grad was gefunden:
www.delphi-forum.de/viewtopic.php?t=15564

thx!

_________________
-I am what I am and I do what I can-