打开控制棉的程序:
Process myProcess = new Process();
myProcess.StartInfo.FileName = "timedate.cpl";

myProcess.Start();

解决方案 »

  1.   

    System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
    private void Form2_Load(object sender, System.EventArgs e)
    {
    myProcess.StartInfo.FileName = "control.exe";
    myProcess.StartInfo.Verb = "timedate.cpl";
    myProcess.Start();
    myProcess.Exited+=new EventHandler(myProcess_Exited);
    }
    private void myProcess_Exited(object sender, EventArgs e)
    {
    在进程退出时发生。
    }
      

  2.   

    不好意思看错题了。
    System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
    bool tag=false;
    private void Form2_Load(object sender, System.EventArgs e)
    {
    myProcess.StartInfo.FileName = "control.exe";
    myProcess.StartInfo.Verb = "timedate.cpl";
    myProcess.Start();
    myProcess.Exited+=new EventHandler(myProcess_Exited);
    while(tag){}
    }
    private void myProcess_Exited(object sender, EventArgs e)
    {
             tag=ture;
    }
      

  3.   

    好像问题出在下面的语句中:
    myProcess.StartInfo.FileName = "control.exe";
    myProcess.StartInfo.Verb = "timedate.cpl";
    myProcess.Start();最后一条语句好像有问题啊
      

  4.   


    myProcess.StartInfo.FileName = "control";//试试
    myProcess.StartInfo.Verb = "timedate.cpl";//这个确定?
    myProcess.Start();
      

  5.   

    问题解决了 ,上面的代码是有问题,我声明了一个ProcessStarInfo 类的对象 然后myProcess的 然后用它给startInfo属性赋值就好了。