All pastes #28928 Raw Edit

Unnamed

public text v1 · immutable
#28928 ·published 2005-11-16 17:28 UTC
rendered paste body
procedure TForm1.Button4Click(Sender: TObject);
var
  i:integer;
begin
  IdTCPClient.Disconnect;
  for i := 0 to listviewServers.Items.Count - 1  do
  begin
    Connected := False;
    Error := False;
    IdTCPClient.Port := 4899;
    IdTCPClient.Host := listviewServers.Items.Item[i].SubItems[0];
     try
      try
        IdTCPClient.Connect();
       
        if IdTCPClient.Connected = True then //the bools tell the app that a port is open
        begin
          listviewServers.Items.Item[i].SubItems[1] := 'Online';
          IdTCPClient.Disconnect;
        end
        else
          listviewServers.Items.Item[i].SubItems[1] := 'Offline';
      finally
        IdTCPClient.Disconnect;
      end; 
     except
     // Here you need 2 enter ur termination code on exception
     end;
    end;
  end;
end;