因为修改了配置文件,需要关闭软件重新启动进行确认。

 

 


 

//触发退出程序事件
private void button1_Click(object sender, EventArgs e)
        {
             Application.ExitThread();
            Thread thtmp = new Thread(new ParameterizedThreadStart(run));
            object appName = Application.ExecutablePath;
            Thread.Sleep(1);
            thtmp.Start(appName);
        }
 private void run(Object obj)
        {
            Process ps = new Process();
            ps.StartInfo.FileName = obj.ToString();
            ps.Start();
        }
 
注:Process 的命名空间为:System.Diagnostics;

 

posted on 2010-02-26 23:02  努力实现目标  阅读(6815)  评论(1编辑  收藏  举报