给分讨论注册表子键项判断是否在的问题!

时间:2022-09-04 22:37:20
比如说HKEY_CORRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Policies\System路径下,用何命令来判断NoDispCPL这一子项是否存在。急

2 个解决方案

#1


Reg:=TRegistry.Create;
try
  Reg.RootKey:=HKEY_LOCAL_MACHINE;
  Reg.OpenKey(Software\Microsoft\Windows\CurrentVersion\
Policies\System',True);
  if  Reg.ValueExists('NoDispCPL') = True then 
  ............................
finally
  Reg.CloseKey;
end;

#2


少个引号呢.先定位到要的根键.再打开要找的子键.如果返回值是真就有了啊..

#1


Reg:=TRegistry.Create;
try
  Reg.RootKey:=HKEY_LOCAL_MACHINE;
  Reg.OpenKey(Software\Microsoft\Windows\CurrentVersion\
Policies\System',True);
  if  Reg.ValueExists('NoDispCPL') = True then 
  ............................
finally
  Reg.CloseKey;
end;

#2


少个引号呢.先定位到要的根键.再打开要找的子键.如果返回值是真就有了啊..