procedure TForm1.load(Sender: TObject);
var f: integer;
begin
//Fenster auf Bildschirmgröße setzen
f:=(Width-CLientWidth)
div 2;
setbounds(-f,-f,Screen.Width+2*f,Screen.Height+2*f);
//Stringgrid Überschriften setzen
stringgrid1.cells[1,0]:='
HTTP';
stringgrid1.cells[2,0]:='
SMTP';
stringgrid1.Cells[3,0]:='
FTP';
stringgrid1.cells[4,0]:='
POP3';
stringgrid1.cells[5,0]:='
HTTPS';
end;
procedure TForm1.Button1Click(Sender: TObject);
var i : integer;
begin
ado_q2.sql.CommaText := '
SELECT * from Serverdaten';
ado_q2.open;
ado_q2.First;
sock := TTCPClient.Create(SELF);
l := 0;
i := 0;
while not ado_q2.Eof
do
begin
stringgrid1.Cells[0,ado_q2.recno]:= ado_q2.FieldByName('
Servername').asstring;
sock.RemoteHost := ado_q2.FieldByName('
IPAdresse').AsString;
repeat
if ado_q2.FieldByName('
HTTP').asstring = '
true'
then
begin
Sock.RemotePort := '
80';
l := 1;
ConnPub;
end;
if ado_q2.Fieldbyname('
HTTPS').asstring = '
true'
then
begin
Sock.RemotePort := '
443';
l := 2;
ConnPub;
end;
if ado_q2.FieldByName('
POP3').asstring = '
true'
then
begin
sock.RemotePort := '
110';
l := 3;
ConnPub;
end;
if ado_q2.fieldbyname('
SMTP').asstring = '
true'
then
begin
sock.RemotePort := '
25';
l := 4;
connpub;
end;
if ado_q2.FieldByName('
FTP').asstring = '
true'
then
begin
sock.RemotePort := '
21';
l := 5;
connpub;
end;
i := i + 1;
until i=5;
ado_q2.Next;
end;
ado_q2.Close;
sock.free;
end;
procedure TForm1.ConnPub;
begin
Sock.OnConnect := Connected;
Sock.OnError := SocketError;
Sock.Active := true;
Application.ProcessMessages;
Sock.Active := false;
end;
procedure TForm1.Connected(Sender: TObject);
begin
stringgrid1.Font.Color := clGreen;
stringgrid1.Cells[l,ado_q2.RecNo] := '
Online';
end;