我爱Aspx >> VB.Net >> VB.NET中实现关机/休眠/重启/注销的类If (LookupPrivilegeValue("", privilege, privilegeLUID)) = 0 Then Throw New PrivilegeException(FormatError(Marshal.GetLastWin32Error()))
tokenPrivileges.PrivilegeCount = 1
tokenPrivileges.Privileges.Attributes = SE_PRIVILEGE_ENABLED
tokenPrivileges.Privileges.pLuid = privilegeLUID
Dim Size As Integer = 4
If (AdjustTokenPrivileges(tokenHandle, 0, tokenPrivileges, 4 + (12 * tokenPrivileges.PrivilegeCount), newPrivileges, Size)) = 0 Then Throw New PrivilegeException(FormatError(Marshal.GetLastWin32Error()))
End Sub
Protected Sub SuspendSystem(ByVal hibernate As Boolean, ByVal force As Boolean)
If Not CheckEntryPoint("powrprof.dll", "SetSuspendState") Then Throw New PlatformNotSupportedException("The SetSuspendState method is not supported on this system!")
SetSuspendState(Convert.ToInt32(IIf(hibernate, 1, 0)), Convert.ToInt32(IIf(force, 1, 0)), 0)
【我对这篇文章有话说?】
VB.NET实现五子棋的人工智能(1)[05-20]
VB.NET实现五子棋的人工智能(2)[05-20]
在.NET环境下将报表数据导出EXCE..[05-20]
在.NET中应用MATLAB算法[05-20]
.NET环境下几种不同的邮件发送解..[05-20]
在VB.NET中改变显示器的分辩率[05-20]
VB.NET中使用代表对方法异步调用[05-20]
.NET平台下Web树形结构程序设计[05-20]
Visual Basic.NET带来的新方法(一..[05-20]
Visual Basic.NET带来的新方法(二..[05-20]
VB.NET实现五子棋的人工智能(1)[05-20]
VB.NET实现五子棋的人工智能(2)[05-20]
在.NET环境下将报表数据导出EXCE..[05-20]
在.NET中应用MATLAB算法[05-20]
.NET环境下几种不同的邮件发送解..[05-20]
在VB.NET中改变显示器的分辩率[05-20]
VB.NET中使用代表对方法异步调用[05-20]
.NET平台下Web树形结构程序设计[05-20]
Visual Basic.NET带来的新方法(一..[05-20]
Visual Basic.NET带来的新方法(二..[05-20]