调用一个可执行exe
private void button1_Click(object sender, EventArgs e)
{
    System.Diagnostics.Process.Start(Application.StartupPath + @"\FormDec\FormDec.exe");
}
路径一点问题也没有,FormDec.exe也是可执行文件,即使把路径考到网络地址也能正确执行
但是一点button,就报出"WinFormDesigner发生问题,必须关闭,谨此道歉"
哪位高手能告诉我为什么,怎么解决或者绕过这个问题

解决方案 »

  1.   

    !@#$%^&*
       没遇到过
      

  2.   

    你换个别的exe 文件, 有可能是权限问题。我这里刚试的没有问题
      

  3.   

    [color=#FF0000]这个经典。[/color]
      

  4.   

    FormDec.exe单独执行没有问题啊,可以执行的,而且调用其他的exe文件也是好的
      

  5.   

    FormDec 是什么文件,有什么特殊的权限么
      

  6.   

    FormDec.exe是另一個程序啊,沒有權限的設置呀
      

  7.   

                            Cpt.Windows.Forms.ToolBoxCategory cate = new Cpt.Windows.Forms.ToolBoxCategory();
                            cate.ImageIndex = -1;
                            cate.IsOpen = true;
                            cate.Name = category.Name;
                            cate.Parent = null;                        Cpt.Windows.Forms.ToolBoxItem item = new Cpt.Windows.Forms.ToolBoxItem();
                            item.Tag = null;
                            item.Name = "指針";
                            item.Parent = null;
                            cate.Items.Add(item);貌似这段代码有问题,但为什么我直接运行的时候没错,间接调用exe就有错了呢
    报的错误是"
    類型 'System.ArgumentException' 的未處理例外狀況發生於 System.Drawing.dll其他資訊: 參數無效。"
      

  8.   

    FormDec.exe单独是否能运行,不是process问题
      

  9.   

    已经解决了            Process p = new Process();
                p.StartInfo.FileName = "cmd.exe";           //设定程序名
                 p.StartInfo.UseShellExecute = false;        //关闭Shell的使用
                 p.StartInfo.RedirectStandardInput = true;   //重定向标准输入
                 p.StartInfo.RedirectStandardOutput = true;  //重定向标准输出
                p.StartInfo.RedirectStandardError = true;   //重定向错误输出
                p.StartInfo.CreateNoWindow = true;          //设置不显示窗口
                p.StartInfo.WorkingDirectory = @"E:\";
                p.Start();   //启动
                p.StandardInput.WriteLine("新增文字文件.exe");
                p.StandardInput.WriteLine("exit");