/// <summary>
/// 使用指定的参数启动应用程序
/// </summary>
/// <param name="fileName">待启动的exe文件路径</param>
/// <param name="param">参数</param>
/// <param name="hide">是否以隐藏方式运行</param>
private static void ProcessStart(string fileName, string param, bool hide)
{
if (hide)
{
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.UseShellExecute = true;
p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
p.StartInfo.FileName = fileName;
p.StartInfo.Arguments = param;
p.Start();
}
else System.Diagnostics.Process.Start(fileName, param);
}
|