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