How to list available service names using C#

K

Kondapanaidu

Hi,

I am using C#.NET 2.0 along with WIN2K Professional.

How to list available servicenames using C#(Under services.msc)

Please send me the example code for this.

Thanks in advance.

Thanks & regards
Kondapanaidu
 
N

Nicholas Paldino [.NET/C# MVP]

Kondapanaidu,

You should use the classes in the System.Management namespace to select
all instances of the Win32_Service class through WMI.

Hope this helps.
 
C

Chris Dunaway

Nicholas said:
Kondapanaidu,

You should use the classes in the System.Management namespace to select
all instances of the Win32_Service class through WMI.

What's wrong with using System.ServiceProcess.GetServices() ??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top