Build a list of services that start with a particular string

  • Thread starter Thread starter B
  • Start date Start date
B

B

I am building a Windows Service Control Manager and I am
trying to filter all the services installed on the
computer that start with the string "abc" for example.
The GetServices() method returns all of the services on
the computer and is overloaded to retrieve remote ones as
well.
How would I filter the list or add each one seperately?


thanks in advance
 
Hello,

Thanks for posting in the group.

After using GetServices(), we could get a list of ServiceControllers
objects. By using its ServiceName property, we could get the name of each
service. I think we could build a string list using ArrayList class .net
framework based on serivce name. Then you could filter the list by string
operation.

Did it answer your question? Please post here if you have follow up
questions.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!Content-Class: urn:content-classes:message
!From: "B" <[email protected]>
!Sender: "B" <[email protected]>
!Subject: Build a list of services that start with a particular string
!Date: Mon, 1 Sep 2003 09:22:39 -0700
!Lines: 10
!Message-ID: <[email protected]>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!Thread-Index: AcNwpUNBaU5HuBjyS4y+2GTvd3Z5/Q==
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Newsgroups: microsoft.public.dotnet.framework
!Path: cpmsftngxa06.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework:52710
!NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
!X-Tomcat-NG: microsoft.public.dotnet.framework
!
!I am building a Windows Service Control Manager and I am
!trying to filter all the services installed on the
!computer that start with the string "abc" for example.
!The GetServices() method returns all of the services on
!the computer and is overloaded to retrieve remote ones as
!well.
! How would I filter the list or add each one seperately?
!
!
!thanks in advance
!
 
Back
Top