To list installed services in C# and VB.NET you can use the following snippet.
Sample C#
public static void ListInstalledServices() { var services = ServiceController.GetServices(); foreach (var service in services) { Console.WriteLine(@"Installed: {0}", service.ServiceName); } }
Sample VB.NET
Public Shared Sub ListInstalledServices() Dim services = ServiceController.GetServices() For Each service As var In services Console.WriteLine("Installed: {0}", service.ServiceName) Next End Sub
RT @CodeSnippetsNET: How to list all installed win-services in .NET http://t.co/15vhmpoI1C list-all-installed-windows-services #csharp #vb …