Example #1
0
        /// <summary>
        /// This method calls the SystemMonitor method in the ProcessMethod class and returns a data table with the process information
        /// </summary>
        /// <returns>Datatable</returns>
        public DataTable ProcessMonitor()
        {
            DataTable alProperties = new DataTable();

            alProperties = ProcessMethod.SystemMonitor(connectionScope);
            return(alProperties);
        }
Example #2
0
        public ArrayList RunningProcesses()
        {
            ArrayList alProcesses = new ArrayList();

            alProcesses = ProcessMethod.RunningProcesses(connectionScope);
            return(alProcesses);
        }
Example #3
0
        public static string StartProcess(string machineName, string processPath)
        {
            ManagementClass processTask = new ManagementClass(@"\\" + machineName + @"\root\CIMV2",
                                                              "Win32_Process", null);
            ManagementBaseObject methodParams = processTask.GetMethodParameters("Create");

            methodParams["CommandLine"] = processPath;
            ManagementBaseObject exitCode = processTask.InvokeMethod("Create", methodParams, null);

            return(ProcessMethod.TranslateProcessStartExitCode(exitCode["ReturnValue"].ToString()));
        }
Example #4
0
 public string GetProcessOwnerSID(string processName)
 {
     return(ProcessMethod.ProcessOwnerSID(connectionScope, processName));
 }
Example #5
0
 public void SetPriority(string processName, ProcessPriority.priority priority)
 {
     ProcessMethod.ChangePriority(connectionScope, processName, priority);
 }
Example #6
0
 public void TerminateProcess(string processName)
 {
     ProcessMethod.KillProcess(connectionScope, processName);
 }
Example #7
0
 public string CreateProcess(string processPath)
 {
     return(ProcessMethod.StartProcess(Environment.MachineName, processPath));
 }
Example #8
0
 public String returnUsageForProcess(int pid)
 {
     return(ProcessMethod.getUsageForProcess(pid, connectionScope));
 }