Option Explicit Dim hR As Long Private Const HKEY_LOCAL_MACHINE = &H80000002 Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long ' Note that if you declare the lpData parameter as String, you must pass it By Value. Private Sub Command1_Click() RegOpenKey HKEY_LOCAL_MACHINE, "SOFTWARE/Microsoft/.NETFramework/v2.0.50727/NGENService/ListenedState", hR '这里是项名 Dim r As Long r = RegQueryValueEx(hR, "RootstoreDirty", 0, 0, 0, 0) If r = 2 Then MsgBox "不存在" Else MsgBox "存在" End If End Sub
本版积分规则 发表回复 回帖并转播 回帖后跳转到最后一页
QQ咨询|关于我们|Archiver|手机版|小黑屋|( 辽ICP备15012455号-4 ) Powered by 期权论坛 X3.2 © 2001-2016 期权工具网&期权论坛 Inc.
下载期权论坛手机APP