Autor Beitrag
whitef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 202
Erhaltene Danke: 1

Windows X
Delphi XE X
BeitragVerfasst: So 22.07.07 15:20 
hallo...

vorab ich hab die suchfunktion bis zum tode gequält und ich hatte nur probleme mit den vorschlägen.

Vlt. könnt ihr ja mir helfen.

Ich habe ein Programm, es soll allerding mittels button ein ping starten.
der ping läuft auf ein host, der mittels editbox erfasst werden sollte (IP oder www-adresse url).
der interval des pings, sollte sich auch mittels editbox erfassen.

Also ich habe schon mit einem timer experimentiert, dieser funktioniert auch. allerdings hab ich keinen blassen schimmer wie der ping source ist.

hier mal mein stück quelltext:
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:
72:
73:
74:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, JvTimer, JvExControls, JvLabel, JvSlider, StdCtrls, ExtCtrls, ComCtrls,
  JvExStdCtrls, JvEdit, JvButton, JvTransparentButton, JvListBox, JvLED,
  IdBaseComponent, IdComponent, IdRawBase, IdRawClient, IdIcmpClient, winsock;

type
    TForm1 = class(TForm)
    JvLabel1: TJvLabel;
    JvEdit1: TJvEdit;
    JvTransparentButton1: TJvTransparentButton;
    JvTransparentButton2: TJvTransparentButton;
    JvLED1: TJvLED;
    JvListBox1: TJvListBox;
    Timer1: TTimer;
    JvEdit2: TJvEdit;
    IdIcmpClient1: TIdIcmpClient;
    procedure JvTransparentButton1Click(Sender: TObject);
    procedure JvTransparentButton2Click(Sender: TObject);
    procedure JvEdit1Change(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);


  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
  sTime: string;
  IP,BYTES, TTL, TIME : string;


implementation

{$R *.dfm}


procedure TForm1.JvTransparentButton1Click(Sender: TObject);
var IdIcmpClient: TIdIcmpClient;
begin
Timer1.Enabled := True;

end;

procedure TForm1.JvTransparentButton2Click(Sender: TObject);
begin
Timer1.Enabled := False;
end;

procedure TForm1.JvEdit1Change(Sender: TObject);
begin
Timer1.Interval := StrToInt(JvEdit1.Text);
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  JvListBox1.Items.Add('Timer1');
  JvListBox1.ItemIndex := JvListBox1.Items.Count -1;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Timer1.Interval := StrToInt(JvEdit1.Text);
end;

end.
whitef Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 202
Erhaltene Danke: 1

Windows X
Delphi XE X
BeitragVerfasst: So 22.07.07 15:49 
also im großen ganzen bräuchte ich halt sowas:


Wenn connection zu dem eingegebenen server besteht, dann soll er ein label anzeigen, wenn nicht dann anderes label anzeigen.
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: So 22.07.07 15:56 
sieh dir an besten mal die Indy-Komponenten an. Da gibts ne komponente mit der man pingen kann.

lg elundril
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: So 22.07.07 18:41 
Moin!

user profile iconelundril hat folgendes geschrieben:
sieh dir an besten mal die Indy-Komponenten an. Da gibts ne komponente mit der man pingen kann.

Der Indy-Ping setzt auf RawSockets auf und verlangt daher Admin-Rechte. :? Hier gibt´s eine Ping-Unit, die das auch ohne kann, mit Beispielprogramm. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.