您的位置:首页 > 其它

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

2010-03-02 09:16 274 查看
在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");//------------重起计算机
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: