前两天看到这个帖子就想回,可是试了几次都不能回帖,今天终于可以了
VB里可以通过编程关机,是不是关掉电源不清楚,代码如下(用到API):
Global Const EWX_LOGOFF = 0 Global Const EWX_REBOOT = 2 Global Const EWX_SHUTDOWN = 1 Declare Function ExitWindows Lib "User32" Alias "ExitWindowsEx" (ByVal dwOptions As Long, ByVal dwReserved As Long) As Long lresult = ExitWindowsEx(EWX_SHUTDOWN, 0&) '关闭计算机 lresult = ExitWindowsEx(EWX_REBOOT, 0&) '重新启动计算机
|