引用 | 编辑
ebolaman
2010-11-09 19:37 |
1楼
▲ ▼ |
这种要去 英文网站才能找到较丰富的资料
Binary World : http://binaryworld.net/Main/CodeDetail.aspx?CodeId=465 叙述: This function will determine whether or not a thread is running in the user context of the local Administrator account. You need to examine the access token associated with that thread using the GetTokenInformation() API, since this access token represents the user under which the thread is running. By default the token associated with a thread is that of its containing process, but this user context will be superceded by any token attached directly to the thread. So to determine a thread's user context, first attempt to obtain any token attached directly to the thread with OpenThreadToken(). If this fails, and it reports an ERROR_NO_TOKEN, then obtain the token of the thread's containing process with OpenProcessToken(). ![]() |
引用 | 编辑
三仙
2010-11-09 21:31 |
2楼
▲ |
下面是引用 sob790717 于 2010-11-07 11:15 发表的 判断XP系统使用者权限: Try it. 复制程式 Private Declare Function IsNTAdmin Lib "advpack.dll" _ (ByVal dwReserved As Long, ByRef lpdwReserved As Long) As Long Private Sub Form_Load() Dim blnAdmin As Boolean blnAdmin = CBool(IsNTAdmin(ByVal 0&, ByVal 0&)) If Not blnAdmin = False Then MsgBox "Administrator rights." End Sub ![]() |