Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public ArrayList RunningProcesses()
        {
            ArrayList alProcesses = new ArrayList();

            alProcesses = ProcessMethod.RunningProcesses(connectionScope);
            return(alProcesses);
        }
Ejemplo n.º 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()));
        }
Ejemplo n.º 4
0
 public string GetProcessOwnerSID(string processName)
 {
     return(ProcessMethod.ProcessOwnerSID(connectionScope, processName));
 }
Ejemplo n.º 5
0
 public void SetPriority(string processName, ProcessPriority.priority priority)
 {
     ProcessMethod.ChangePriority(connectionScope, processName, priority);
 }
Ejemplo n.º 6
0
 public void TerminateProcess(string processName)
 {
     ProcessMethod.KillProcess(connectionScope, processName);
 }
Ejemplo n.º 7
0
 public string CreateProcess(string processPath)
 {
     return(ProcessMethod.StartProcess(Environment.MachineName, processPath));
 }
Ejemplo n.º 8
0
 public String returnUsageForProcess(int pid)
 {
     return(ProcessMethod.getUsageForProcess(pid, connectionScope));
 }