Firebird - testar se esta rodando numa maquina |
Top Previous Next |
|
uses IdTCPClient;
function ServerIsRunning(const AHost: string; const APort: Integer): Boolean; begin with TIdTCPClient.Create(nil) do begin Host := AHost; Port := APort; Result := TRue; try Connect; Disconnect; except Result := False; end; Free; end; end;
procedure TForm1.Button1Click(Sender: TObject); begin if ServerIsRunning('SERVER02' { ou IP },'3050') then ShowMessage('Firebird Running') else ShowMessage('Firebird not running'); end; |