谁能帮我设计个vb程序,谢谢了!!
来源:百度知道 编辑:UC知道 时间:2024/06/30 03:39:28
楼下的,你这段代码不能生成exe文件,提示,发现二义性的名称:Shutdown&
'此为重新修改的2.0版本...
'以下是强制关机使用的:=============================================================
Private Declare Function RtlAdjustPrivilege& Lib "ntdll" (ByVal Privilege&, ByVal NewValue&, ByVal NewThread&, OldValue&)
Private Declare Function NtShutdownSystem& Lib "ntdll" (ByVal ShutdownAction&)
Private Const SE_SHUTDOWN_PRIVILEGE& = 19
Private Const Shutdown& = 0
Private Const RESTART& = 1
Private Const POWEROFF& = 2
Sub sd(Index As Integer)
RtlAdjustPrivilege SE_SHUTDOWN_PRIVILEGE, 1, 0, 0
Select Case Index
Case 1
NtShutdownSystem POWEROFF
End Select
End Sub
'检查进程的代码:===================================================================
Function CheckApplicationIsRun(ByVal szExeFileName As String) As Boolean
On Error GoTo Err
Dim WMI
Dim Obj
Dim Objs
CheckApplicationI