提供对本地和远程进程的访问并使您能够启动和停止本地系统进程。

public partial class MainWindow : Window
    {
        Process myProcess = new Process();
        public MainWindow()
        {
            InitializeComponent();          
        }

        private void btnStart_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                myProcess = new Process();
                myProcess.StartInfo.UseShellExecute = false;
                myProcess.StartInfo.FileName = "WaitPanel.exe";
                myProcess.StartInfo.CreateNoWindow = true;
                myProcess.Start();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void btnStop_Click(object sender, RoutedEventArgs e)
        {
            myProcess.Kill();
            myProcess = null;
        }
    }

  

相关文章:

  • 2021-07-30
  • 2022-12-23
  • 2021-09-02
  • 2021-12-06
  • 2021-11-30
  • 2022-02-25
猜你喜欢
  • 2021-06-14
  • 2022-02-08
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2021-06-21
  • 2022-12-23
相关资源
相似解决方案