Autor Beitrag
lolol
Hält's aus hier
Beiträge: 5

Win2000
Delphi 6 Personal
BeitragVerfasst: Do 20.11.03 22:03 
Hi!

Ich bin Anfänger in Delphi und habe mir folgendes Programm gecodet.

Es soll die Datei "ip.txt" vom Server laden und die Darin enthaltene IP auslesen!

An meinem Rechner funtioniert das Programm einwandfrei (Ich gehe über einen Software-Router, der auf einem anderen Rechner intalliert ist, ins Netz, habe also immer eine Verbindung!

Nun habe ich das Programm auf einem anderen Rechner testen wollen, doch ich bekomme immer den Error Connection refused, woran kann es liegen? Der Rechner läuft auf XP und baut die Internetverbindung über DFÜ auf....

Hier mal mein Programm-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:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
  IdHTTP, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    edIP: TEdit;
    Panel1: TPanel;
    btGetIp: TButton;
    labUpdate: TLabel;
    IdHTTP1: TIdHTTP;
    Label1: TLabel;
    procedure btGetIpClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.btGetIpClick(Sender: TObject);

var
  Seite, IP, HP: string;
  BeginIP, EndIP, i: integer;

var
  update:string;
  beginup,endup, f: integer;

begin
  btGetIp.Enabled := False;
  HP      := 'http://www.malteblaettermann.de/ip.txt';
  Seite := IdHTTP1.Get(HP);
  BeginIP := Pos('BEGINIP', Seite) + Length('BEGINIP');
  EndIP   := Pos('ENDIP', Seite);
  IP      := '';
  for i := BeginIP to ENDip - 1 do
  begin
    IP := IP + Seite[i];
  end;
  beginup := Pos('BEGINUP', Seite) + Length('BEGINUP');
  endup   := Pos('ENDUP', Seite);
  update  := '';
  for f := beginup to endup - 1 do
  begin
    update := update + Seite[f];
  end;

  labUpdate.Caption := 'Update: ' + update;
  edIP.Text := IP;



  btGetIp.Enabled := True;


end;

end.


Naja, evtl bin ich einfach nur blind, bitte helft mir auf die Sprünge!!!

cu malte
inselberg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 458



BeitragVerfasst: Fr 21.11.03 10:51 
ist die verbindung ins internet schon offen?

bzw kannst du dir die textdatei auf "normalem" wege ziehen?

_________________
hans bist du das ?
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Fr 21.11.03 16:17 
das kann eigendlich nur an den internet einstellungen des PCs liegen !

_________________
In the beginning was the word.
And the word was content-type: text/plain.
lolol Threadstarter
Hält's aus hier
Beiträge: 5

Win2000
Delphi 6 Personal
BeitragVerfasst: Mo 24.11.03 00:42 
Hi!

Ich Dussel!!!

Es war die Firewall, Sie war auf "Deny Unknown" gestellt!!!

Danke euch dennoch!!

cu lolol
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mo 24.11.03 20:07 
na also !

_________________
In the beginning was the word.
And the word was content-type: text/plain.