在vb6中选中了如何检测以管理员身份运行此应用程序复选框 [英] How to detect run this application as adminstrator checkbox is checked in vb6
问题描述
你好,
不幸的是,由于时间不利于我,我目前无法将我的VB6应用程序转换为VB.NET.结果,我遇到了以下问题:
我有一个用VB6编写的应用程序.当此应用程序由客户端运行时,它需要消除Regasm dll.这里的问题是该应用程序必须以管理员身份运行.我不能转到每个客户端并更改以管理员身份运行此应用程序"复选框.
因此,请问我可以在我的vb6代码中调用任何api来检测是否选中了此复选框吗?
非常感谢您的帮助.
Behzad.
#If Win16 Then
公共声明函数IsUserAnAdmin Lib"shell32"别名#680"()只要
#Else
公共声明函数IsUserAnAdmin Lib"shell32"()只要长
#End If
选择大小写IsUserAnAdmin()
情况1:
''用户是管理员
大小写错误:
''用户不是管理员
结束选择
尝试一下.
http://www.bigresource.com/Tracker/Track-vb-bQQLOflX7x/ [ ^ ]
>
Hello,
Unfortunately due to time being against me I can not convert my VB6 application to VB.NET at this moment of time. As a result I am faced with this issue which is detailed below:
I have an application which is written in VB6. When this application is run by a client, it needs to exexcute a Regasm a dll. The issue here is the application has to be run as an administrator. I can not go to every client and change the checkbox "Run this application as an administrator".
So, is there any api I can call in my vb6 code in order to detect that this check box is checked please?
Your help is very much appreciated.
Behzad.
#If Win16 Then
Public Declare Function IsUserAnAdmin Lib "shell32" Alias "#680" () As Long
#Else
Public Declare Function IsUserAnAdmin Lib "shell32" () As Long
#End If
Select Case IsUserAnAdmin()
Case 1:
'' User is Admin
Case False:
''User is not Admin
End Select
try this one out.
http://www.bigresource.com/Tracker/Track-vb-bQQLOflX7x/[^]
这篇关于在vb6中选中了如何检测以管理员身份运行此应用程序复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!