03-06-2014 20:28 tarihinde, FreeMan yazdı:
Hello,
I need get any or all service's list and info's. And its work on linux, win & os x. Why I need, I need "firebird" service is working and if its work, where is path detail.
Thank you
Kubuntu 14.04 x64: fpc & lazarus svn
This is my solution, for linux. I added "="symbol for can use tStrings.IndexOfName for osx comm,args Can not add symbol so need some cod for search, and I'm not install lazarus on osx so I can not test code, windows too, I hope some one test that and share

...
uses Process;
{$R *.lfm}
procedure TForm1.Button1Click(Sender: TObject);
var
  AProcess: TProcess;
  I:integer;
begin
  Memo1.Lines.Clear;
    AProcess := TProcess.Create(nil);
    AProcess.CommandLine := 'ps axeo "%c=%a";
    AProcess.Options := AProcess.Options + [poWaitOnExit, poUsePipes];
    AProcess.Execute;
    Memo1.Lines.LoadFromStream(AProcess.Output);
    AProcess.Free;

    I:=Memo1.Lines.IndexOfName('fbserver       ');
    if I >=0then self.Caption := Memo1.Lines.ValueFromIndex[I]
    else self.Caption := 'not found';
end;

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to