判斷當前使用者是否為系統管理員的例項

TolyHuang發表於2009-02-05

[@more@]
Option Explicit
Private Declare Function IsUserAnAdmin Lib "shell32" () As Long
   

Private Sub Form_Load()

   Command1.Caption = "IsUserAnAdmin"
   Label1.Caption = ""
   
End Sub

   
Private Sub Command1_Click()
  
   Select Case IsUserAnAdmin()
      Case 1:
         Label1.Caption = "YES"
         
      Case False:
         Label1.Caption = "NO"
   End Select

End Sub

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9437124/viewspace-1016753/,如需轉載,請註明出處,否則將追究法律責任。

相關文章