Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Problem mit Indy??? (https://www.delphipraxis.net/24659-problem-mit-indy.html)

th1984 24. Jun 2004 09:03


Problem mit Indy???
 
Hallo...

ich habe ein Problem mit meinem kleinen Programm... :wall: Und zwar bleibt es dauert hängen bzw. reagiert nicht mehr. Es läuft zwar dann nach zwei Minuten weiter, bleibt allerdings erneut hängen. Ich habs mit einer Pause probiert usw, funkt aber nicht wirklich.

Was ist das für ein Programm? Ich möchte damit mit verschiedenen Proxys auf ein Script zugreifen... gleichzeitig oder der Reihe nach, ich habs halt nur der Reihe nach zusammengebracht (und das auch nicht richtig).. :?

Hier mein kleines Programm: Ich hoffe es kann mir jmd helfen

Delphi-Quellcode:
unit InternetZugriff;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection,
  IdTCPClient, IdHTTP, IEHTTP3, CoolTrayIcon, DB, ADODB;

type
  TForm1 = class(TForm)
    Internet: TIdHTTP;
    Button1: TButton;
    Edit1: TEdit;
    Memo1: TMemo;
    Edit2: TEdit;
    local: TIEHTTP;
    Table: TADOTable;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure Delay(dwMilliseconds: Longint);
var
  iStart, iStop: DWORD;
begin
  iStart := GetTickCount;
  repeat
    iStop := GetTickCount;
    Application.ProcessMessages;
  until (iStop - iStart) >= dwMilliseconds;
end;


procedure TForm1.Button1Click(Sender: TObject);
  var Proxy: String;
  var Port: Integer;
  var anzahl: Integer;
  var i: Integer;
begin
  table.open;
  table.First;
  anzahl := table.RecordCount;
  for i:=1 to anzahl do begin
    Edit2.Text := table.FieldbyName('ProxyIp').AsString;
    Internet.ProxyParams.ProxyServer := table.FieldbyName('ProxyIP').AsString;
    Internet.ProxyParams.ProxyPort := table.FieldbyName('ProxyPort').AsInteger;
    Try
      Memo1.Text := Internet.Get(Edit1.Text);
      Delay(250);
      Internet.Disconnect;
    Except
    End;
    table.Next;
  End;

end;
end.
Ich danke schon jetzt für eure Hilfe



Thomas

easywk 24. Jun 2004 09:17

Re: Problem mit Indy???
 
Hi.

Ich habe mit der Http-Kompo von Indy noch nicht gearbeitet, wenn ich es aber mal mit der Ftp-Komponente vergleiche, dann fällt mir auf, dass du zwar abschließend ein Disconnect machst ... das Internet.Connect finde ich aber nirgends ...

cu
easywk

th1984 24. Jun 2004 09:31

Re: Problem mit Indy???
 
Hallo easywk,

stimmt das hatte ich jetzt ganz vergessen*g*, allerdings hängt sich das programm jetzt ganz auf sobald ich auf den Start Button drücke... Irgendwie kenn ich mich jetzt dann gar nicht mehr aus. Aber danke schon mal für den super anzatz, ich werd natürlich weiter probieren :?

Nuclear-Ping 24. Jun 2004 09:56

Re: Problem mit Indy???
 
Bin zwar auch nicht der Indy-Experte, hab jedoch gelesen, dass man die IdAntiFreeze-Kompo mit auf die Form hauen soll, um zu verhindern, dass das Programm einfriert, weil ... öhm :gruebel: ... vergessen. Sollte aber auch noch irgendwo nachzulesen sein. Probier das mal.

Grüße,
Mario

th1984 24. Jun 2004 10:04

Re: Problem mit Indy???
 
Hallo,

super, jetzt gehts.... Danke für die Lösung

Thomas


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:28 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz