1

What Windows API function can I use to check to see if the current user running my application has administrative privileges?

Here are my OS details : WINDOWS XP, VISTA and WINDOWS 7
Language to be used : C

4

2 に答える 2

2

Shell APIには、これを行う関数IsUserAnAdmin()があります。トークンをいじる必要はありません。

于 2012-05-21T15:19:08.953 に答える
2

Even if the user has administrative privileges it does not mean your program does - it needs to be elevated. This can be done by the user explicitly asking to run it as an administrator, but usually it is requested by the program itself through a manifest that is embedded into the executable. Once the manifest asks for the privileges it is not optional - the program will not run until the user has approved it and supplied the password as necessary.

于 2012-05-21T16:27:48.637 に答える