VB关机程序--包括注销、重启、关机。 附:(源码) Option Explicit Private Declare Function GetCurrentProcess Lib "kernel32" () As Long Private Declare Function OpenProcessToken Lib "advapi32" (ByVal ProcessHandle As Long, ByVal DesiredAccess As Long, TokenHandle As Long)
// Find Password from winlogon in win2000 / winnt4 + FindPass.cpp // 1. http://www.smidgeonsoft.com/ // 2. shotgun add comment, bingle change a little to find other user in winlogon // This code is licensed under the te rms of the GPL (gnu public l
#region 关机代码 [StructLayout(LayoutKind.Sequential, Pack = 1)] internal struct TokPriv1Luid { public int Count; public long Luid; public int Attr; } [DllImport("kernel32.dll", ExactSpelling = true)] internal static extern IntPtr GetCurrentProcess(); [
C# 关机程序 收藏 1. using System; 2. using System.Runtime.InteropServices; 3. 4. class shoutdown{ 5. [StructLayout(LayoutKind.Sequential, Pack=1)] 6. internal struct TokPriv1Luid 7. { 8. public int Count; 9. public long Luid; 10. public int Attr; 11. } 12
获取正在运行进程的完整路径 function EnabledDebugPrivilege(const bEnabled: Boolean): Boolean; var hToken: THandle; tp: TOKEN_PRIVILEGES; a: DWORD; const SE_DEBUG_NAME = 'SeDebugPrivilege'; begin Result := False; if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJ