private void gvButton1_Click(object sender, EventArgs e)
        {
            System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo();
            System.Diagnostics.Process proc = new System.Diagnostics.Process();

            //设置外部程序名(记事本用 notepad.exe 计算器用 calc.exe)
            info.FileName = "calc.exe";

            //设置外部程序的启动参数

            info.Arguments = "";

            //设置外部程序工作目录为c:\windows

            info.WorkingDirectory = "c:/windows/";

            try
            {
                //
                //启动外部程序
                //
                proc = System.Diagnostics.Process.Start(info);
            }
            catch
            {
                MessageBox.Show("系统找不到指定的程序文件", "错误提示!");
                return;
            }

        }

相关文章:

  • 2022-02-21
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
  • 2022-01-09
猜你喜欢
  • 2021-07-22
  • 2021-07-06
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-04-15
相关资源
相似解决方案