代码如下 :
Key := TRegistry.Create;
s := 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Environments\Windows 4.0\Drivers';
Key.OpenKeyReadOnly(s) ;
Result := Key.KeyExists('a');
Key.Free;// 在注册表中查看 'a' 存在!请各位帮助!!!!
Key := TRegistry.Create;
s := 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Environments\Windows 4.0\Drivers';
Key.OpenKeyReadOnly(s) ;
Result := Key.KeyExists('a');
Key.Free;// 在注册表中查看 'a' 存在!请各位帮助!!!!
把s设为'\System\CurrentControlSet\Control\Print\Environments\Windows 4.0\Drivers'
Key.RootKey:=HKEY_LOCAL_MACHINE; //在这里增加根键值
s := '\System\CurrentControlSet\Control\Print\Environments\Windows 4.0\Drivers';
Key.OpenKeyReadOnly(s);
Result :=Key.KeyExists('a');
Key.Free;
Key.RootKey := HKEY_LOCAL_MACHINE;
s := 'System\CurrentControlSet\Control\Print\Environments\Windows 4.0\Drivers';
Key.OpenKeyReadOnly(s); //Key.OpenKey(s,False);
Result := Key.KeyExists(s); //哪来的'a'
Key.Free;