关机和重启代码 [英] codes for shutdown and restart
本文介绍了关机和重启代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想了解有关系统关闭和重新启动工具的vb.net代码的更多信息.请问我4个吗??? :O
I want to know more about the vb.net codes for the system shutdown and restart facility.could you please do it 4 me??? :O
推荐答案
在代码项目中,过去有与此主题有关的几个问题.请参考 ^ ]链接.
There are several questions regarding this topic in the past here in Code Project. Please refer to this[^] link.
查看正确的代码
用于系统关闭
Look at the proper code
For system shutdown
System.Diagnostics.Process.Start("ShutDown", "/s")
立即关闭
For Immediate Shut Down
System.Diagnostics.Process.Start("ShutDown", "-s -t 00")
对于系统重启,使用以下命令
For system restart, below command is used
System.Diagnostics.Process.Start("ShutDown", "/r")
立即重启
For Immediate Restart
System.Diagnostics.Process.Start("ShutDown", "-r -t 00")
这篇关于关机和重启代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文