判斷XP使用者是不是管理員還是 users

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

沒有留言:

張貼留言