public long[] GetMemoryStat(string processName) { ProcessStats ps = new ProcessStats(common); try { return(ps.GetPhysicalMemoryUsage(processName)); } finally { ps = null; } }
public double[] GetCpuStat(string processName) { ProcessStats ps = new ProcessStats(common); try { return(ps.GetCpuUsage(processName)); } finally { ps = null; } }
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; } }
public Core(WindowList windowList, Common common, bool debug = false) : base(windowList, common, debug) { ps = new ProcessStats(common); }
public long[] GetMemoryStat(string processName) { ProcessStats ps = new ProcessStats(common); try { return ps.GetPhysicalMemoryUsage(processName); } finally { ps = null; } }
public double[] GetCpuStat(string processName) { ProcessStats ps = new ProcessStats(common); try { return ps.GetCpuUsage(processName); } finally { ps = null; } }
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; } }