All pastes #429975 Raw Edit

Something

public text v1 · immutable
·published 2007-04-08 17:01 UTC
rendered paste body
using System;
using System.ServiceProcess;

namespace ServiceListApplication
{
    public class MyApplication
    {
        public static void Main()
        {
            ServiceController[] ServiceList = ServiceController.GetServices();
            System.Console.WriteLine("Service\t\tStatus\t\tService name\n------------------------");

            for (int i = 0; i < ServiceList.Length; i++)
            {
                string tmpvar;
                tmpvar = ServiceList[i].ServiceName + "\t\t" + ServiceList[i].Status + "\t\t" + ServiceList[i].DisplayName;
                System.Console.WriteLine(tmpvar);
            }

            Console.WriteLine("------------------------\nPress any key to continue");
            Console.ReadKey();

            return;
        }
    }
}