bev*_*qua 11 c# windows restart
现在我正在使用以下代码重新启动我的应用程序
private static void Restart()
{
ProcessStartInfo proc = new ProcessStartInfo();
proc.WindowStyle = ProcessWindowStyle.Hidden;
proc.FileName = "cmd";
proc.Arguments = "/C shutdown -f -r -t 5";
Process.Start(proc);
}
Run Code Online (Sandbox Code Playgroud)
我的问题是这显示一个"Windows将灾难性地重新启动5 ... 4 ... 3 ......"类型的对话框,非常让人想起Blaster,我怎么能无声地重启Windows,没有任何对话框弹出?
更新:伙计,呃,这是安装程序,它不"只是重新启动你的计算机",它完成安装,然后询问你是否要重新启动,如果你这样做,那么它确实如此,但它没有需要任何糟糕的系统对话框,告诉你在重启之前等待X时间.