Autor Beitrag
Chiller
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34



BeitragVerfasst: Di 30.12.08 21:42 
hallo :-)


nachdem ich nun den quellcode einer seite einlesen kann ;-) (danke jaenicke) habe ich vor als diesem quellcode einzelen variabeln7strings herauszuziehen, was ich nun seit diversen stunden mit pos und posex versucht habe...
also ich jedoch hoffte ich wäre dem ziel nahe, kam plötzlich eine fehlermeldung:

Im Project Versuch.exe ist eine Exeption der Klasse EAccessViolation mit der Meldung 'Zugriffsverletzung bei Adresse 004031C3 im Modul 'Versuch.exe'. Schreiben von Adresse 00473274' aufgetreten.

und eben wieder das übliche bei ereignisse etc dabei...!

mein 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:
39:
40:
41:
42:
unit UHaupt;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, IdHTTP, StrUtils;

type
  TFAnwendung = class(TForm)
    BStart: TButton;
    BEnde: TButton;
    MText: TMemo;
    procedure BStartClick(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  FAnwendung: TFAnwendung;

implementation

{$R *.dfm}

procedure TFAnwendung.BStartClick(Sender: TObject);
var  Text: String;
     HTTP: TIdHTTP;
     a, b: Integer;
begin
  HTTP.Create(nil);
  Text:=HTTP.Get('http://www.hallo.de');
  HTTP.Free;
  a:=(Pos('<meta http-equiv="', Text));
  b:=(Posex('" content="', Text, a));
  if (a>0and (b>0then
    MText.Text:=Copy(Text, a, b-a);
end;

end.


ich hoffe ihr könnte mir helfen...wenn ihr etwas wisst, bitte sagen :-)
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Di 30.12.08 21:52 
Probier mal anstelle von

HTTP.Create(nil);

lieber so etwas:

ausblenden Delphi-Quelltext
1:
HTTP := TIdHttp.Create(nil);					

_________________
We are, we were and will not be.
Chiller Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34



BeitragVerfasst: Di 30.12.08 22:08 
ok, danke, hat geklappt!
Yogu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2598
Erhaltene Danke: 156

Ubuntu 13.04, Win 7
C# (VS 2013)
BeitragVerfasst: Di 30.12.08 23:11 
Hallo,

Das (nil) kannst du bei den Indys auch weglassen. :D

Grüße,
Yogu