示例#1
0
 public PSExecCommandForm(ExtendedForm parentForm, Device device) : base(parentForm)
 {
     InitializeComponent();
     this.DisableDoubleBuffering();
     targetDevice  = device;
     pSExecWrapper = new PSExecWrapper(device.HostName);
     pSExecWrapper.ErrorReceived  += PSExecWrapper_ErrorReceived;
     pSExecWrapper.OutputReceived += PSExecWrapper_OutputReceived;
     this.Text += " - " + device.CurrentUser;
     this.Show();
 }
示例#2
0
        public void UsePsExec()
        {
            if (pSExecWrapper == null)
            {
                pSExecWrapper = new PSExecWrapper(targetDevice.HostName);
                pSExecWrapper.ErrorReceived -= PsExecErrorReceived;
                pSExecWrapper.ErrorReceived += PsExecErrorReceived;

                pSExecWrapper.OutputReceived -= PsExecOutputReceived;
                pSExecWrapper.OutputReceived += PsExecOutputReceived;
            }
        }