コード例 #1
0
ファイル: Program.cs プロジェクト: dangeabunea/PMonitor
        static void Main()
        {
            System.Console.WriteLine("PMonitor Example - Console with custom process monitor impl");

            //We can not use the factory to create our process monitor, bacause the factory only
            //returns the built in implementaitons. However, we can just new-up our
            //concrete instance.
            IProcessMonitor pm = new NoFileConfigProcessMonitor();
            while (true)
            {
                pm.RefreshInformation();
                BasicProcessInformation bpi = pm.GetProcessInformation().Single();

                System.Console.WriteLine("{0} Process {1} is {2}", DateTime.Now.ToString(CultureInfo.InvariantCulture), bpi.FriendlyName, bpi.State.ToString());

                Thread.Sleep(3000);
            }
        }
コード例 #2
0
        static void Main()
        {
            System.Console.WriteLine("PMonitor Example - Console with custom process monitor impl");

            //We can not use the factory to create our process monitor, bacause the factory only
            //returns the built in implementaitons. However, we can just new-up our
            //concrete instance.
            IProcessMonitor pm = new NoFileConfigProcessMonitor();

            while (true)
            {
                pm.RefreshInformation();
                BasicProcessInformation bpi = pm.GetProcessInformation().Single();

                System.Console.WriteLine("{0} Process {1} is {2}", DateTime.Now.ToString(CultureInfo.InvariantCulture), bpi.FriendlyName, bpi.State.ToString());

                Thread.Sleep(3000);
            }
        }