Autor Beitrag
Muratxiv
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 27



BeitragVerfasst: Sa 02.09.06 18:53 
Hallo,
ich programmiere noch nicht lange mit Delphi. Ich möchte von einer Wegbseite den Text in einem Label angezeigt bekommen. Leider zeigt Delphi folgenden Fehler: 'idhttp' does not contain a member named 'Get' at line 29(29:26) Das Programm sieht zurzeit so aus:
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:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,ExtCtrls, idhttp;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
Label1.Caption := IdHTTP.Get('http://muratyiv.mu.ohost.de/beispiel.php');

end;

end.

Würde mich freuen, falls mir jemand helfen könnte :)
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Sa 02.09.06 18:58 
Du brauchst zunächst eine Instanz der Klasse, die du erst erzeugen musst:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
var idh: TIDHTTP;
begin
 idh := IDHTTP.TIdHTTP.Create(self);
 label1.Caption:= idh.Get('http://muratyiv.mu.ohost.de/beispiel.php');
end;



marc ;)
Muratxiv Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 27



BeitragVerfasst: Sa 02.09.06 19:01 
Danke Marc. es klappt :D
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 02.09.06 19:11 
Aber die erzeugte Instanz sollte auch mit idh.Free; wieder freigegeben werden nachdem sie benutzt wurde...