Ejemplo n.º 1
0
        private IResult ExecuteStopCommand()
        {
            IResult ExecuteResult = new ExecutionResult();

            if (SelectedProcess.Length > 0)
            {
                StopProcess       CmdStopProc = new StopProcess();
                ProcessParameters ProcParam   = new ProcessParameters();
                NetworkParameters NetParam    = new NetworkParameters();
                NetParam.RemoteSystemName     = MachineName;
                ProcParam.ProcessName         = SelectedProcess;
                CmdStopProc.ProcessParameters = ProcParam;
                RemoteExecutionManager ProcessStop = new RemoteExecutionManager();
                ProcessStop.Command   = CmdStopProc;
                ProcessStop.NetParams = NetParam;
                ExecuteResult         = ProcessStop.Execute();
            }
            return(ExecuteResult);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Убивалка процесса
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            int id = this.listBox1.SelectedIndex;

            StopProcess?.Invoke(this, new ModelIntEventArgs(id));
        }