欢迎来到Java学习网!
设为首页 | 加入收藏
当前位置: 首页 > 编程开发 > VB语言 >

'模块
Public Declare Function RtlAdjustPrivilege& Lib "ntdll" (ByVal Privilege&, ByVal NewValue&, ByVal NewThread&, OldValue&)


Public Declare Function NtShutdownSystem& Lib "ntdll" (ByVal ShutdownAction&)
Public Const SE_SHUTDOWN_PRIVILEGE& = 19
Public Const shutdown& = 0
Public Const RESTART& = 1
Public Const POWEROFF& = 2

'过程
Sub TurboShutdown()
RtlAdjustPrivilege SE_SHUTDOWN_PRIVILEGE, 1, 0, 0
NtShutdownSystem shutdown '关机
'NtShutdownSystem restart '重启动
'NtShutdownSystem poweroff '待机
End Sub

Private Sub Command1_Click()'按钮1
'调用
Call TurboShutdown

End Sub

    相关教程
    推荐内容