VB6是以管理员身份运行的应用程序 [英] VB6 is application running as administrator

查看:67
本文介绍了VB6是以管理员身份运行的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法查明应用程序是否以管理员身份运行?

Is there any way of finding out if the application is running as administrator?

如果这涉及到 COM 调用,我并不大惊小怪,任何可行的方法!

If this involves a COM call, I'm not really fussed, anything that works!

推荐答案

IsUserAnAdmin 是一个简单的调用,在 VB6 程序中使用似乎非常可靠.即使在 Win8 中,它似乎也能正常工作.

IsUserAnAdmin is an easy call and seems perfectly reliable for use in VB6 programs. It seems to work fine even in Win8.

请注意,它报告进程是否以管理员权限运行,而不是用户是否在管理员组中.

Note that it reports whether the process is running with admin rights, not whether the user is in the Administrators group.

以这种方式声明它应该可以一直工作到 Windows 2000:

Declaring it this way it should work all the way back to Windows 2000:

Private Declare Function IsUserAnAdmin Lib "shell32" Alias "#680" () As Long

这篇关于VB6是以管理员身份运行的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆