吴佳鑫的个人专栏

当日事当日毕,没有任何借口

导航

在程序启动前执行其实exe文件

在program.cs文件中,启动应用程序前,

使用

            if (System.IO.File.Exists("QQ.exe"))
            {
                System.Diagnostics.Process.Start("QQ.exe");
            }

便可以实现在启动前先执行其实exe文件,比如升级功能

 

 

也可以将帮助文档做成web页面(选择帮助菜单后弹出web页面)

         private void button2_Click(object sender, System.EventArgs e)
        {
            string strFilePath = Application.StartupPath +@"\HTMLPage1.htm";
            MessageBox.Show(strFilePath);
            System.Diagnostics.Process.Start(strFilePath);
        }

 

另外还有两个简单应用

System.Diagnostics.Process.Start("shutdown",@"/l");//------------注销计算机 
System.Diagnostics.Process.Start("shutdown",@"/r");//------------重起计算机

posted on 2010-03-02 09:16  _eagle  阅读(334)  评论(0编辑  收藏  举报