コード例 #1
0
        public long[] GetMemoryStat(string processName)
        {
            ProcessStats ps = new ProcessStats(common);

            try
            {
                return(ps.GetPhysicalMemoryUsage(processName));
            }
            finally
            {
                ps = null;
            }
        }
コード例 #2
0
        public double[] GetCpuStat(string processName)
        {
            ProcessStats ps = new ProcessStats(common);

            try
            {
                return(ps.GetCpuUsage(processName));
            }
            finally
            {
                ps = null;
            }
        }
コード例 #3
0
        public int LaunchApp(string cmd, string[] args, int delay = 5,
                             int env = 1, string lang = null)
        {
            Process ps = new Process();

            try
            {
                ProcessStartInfo psi = new ProcessStartInfo();

                psi.FileName = cmd;

                if (args != null)
                {
                    // Space separated arguments
                    psi.Arguments = string.Join(" ", args);
                }

                psi.UseShellExecute = true;
                ps.StartInfo        = psi;
                ps.Start();
                Thread thread = new Thread(new ParameterizedThreadStart(
                                               InternalLaunchApp));
                // Clean up in different thread
                thread.Start(ps);
                Wait(delay);
                return(1);
            }
            catch (Exception ex)
            {
                LogMessage(ex);
                throw new XmlRpcFaultException(123,
                                               "Unhandled exception: " + ex.Message);
            }
            finally
            {
                ps = null;
            }
        }
コード例 #4
0
ファイル: Core.cs プロジェクト: boomuuh/cobra-winldtp
 public Core(WindowList windowList, Common common, bool debug = false)
     : base(windowList, common, debug)
 {
     ps = new ProcessStats(common);
 }
コード例 #5
0
ファイル: Core.cs プロジェクト: boomuuh/cobra-winldtp
 public long[] GetMemoryStat(string processName)
 {
     ProcessStats ps = new ProcessStats(common);
     try
     {
         return ps.GetPhysicalMemoryUsage(processName);
     }
     finally
     {
         ps = null;
     }
 }
コード例 #6
0
ファイル: Core.cs プロジェクト: boomuuh/cobra-winldtp
 public double[] GetCpuStat(string processName)
 {
     ProcessStats ps = new ProcessStats(common);
     try
     {
         return ps.GetCpuUsage(processName);
     }
     finally
     {
         ps = null;
     }
 }
コード例 #7
0
ファイル: Core.cs プロジェクト: boomuuh/cobra-winldtp
        public int LaunchApp(string cmd, string[] args, int delay = 5,
            int env = 1, string lang = null)
        {
            Process ps = new Process();
            try
            {
                ProcessStartInfo psi = new ProcessStartInfo();

                psi.FileName = cmd;

                if (args != null)
                {
                    // Space separated arguments
                    psi.Arguments = string.Join(" ", args);
                }

                psi.UseShellExecute = true;
                ps.StartInfo = psi;
                ps.Start();
                Thread thread = new Thread(new ParameterizedThreadStart(
                    InternalLaunchApp));
                // Clean up in different thread
                thread.Start(ps);
                Wait(delay);
                return 1;
            }
            catch (Exception ex)
            {
                LogMessage(ex);
                throw new XmlRpcFaultException(123,
                    "Unhandled exception: " + ex.Message);
            }
            finally
            {
                ps = null;
            }
        }
コード例 #8
0
 public Core(WindowList windowList, Common common, bool debug = false)
     : base(windowList, common, debug)
 {
     ps = new ProcessStats(common);
 }