All pastes #28940 Raw Edit

Server Port Checker

public text v1 · immutable
#28940 ·published 2005-11-16 18:21 UTC
rendered paste body
procedure TForm1.Button1Click(Sender: TObject);
var
  i:integer;
begin
  TcpClient.Active := False;

  for i := 0 to listviewServers.Items.Count -1 do
  begin
    Connected := False;
    Error := False;
    TcpClient.Active := True;
    TcpClient.RemotePort := '4899';
    TcpClient.RemoteHost := listviewServers.Items.Item[i].SubItems[0];
    if Connected = True then
    begin
      listviewServers.Items.Item[i].SubItems[1] := 'Online';
      TcpClient.Active := False;
    end
    else if Error = True then
    begin
      listviewServers.Items.Item[i].SubItems[1] := 'Offline';
      TcpClient.Active := False;
    end;
  end;
end;