next up previous contents
Next: getSubkeyNames Up: Methods Previous: create   Contents

open

Description

Opens a windows registry key. Static


Syntax

Regkey.open(keyname)


Parameters

keyname
Specifies the key name of the registry. If keyname begins with a predefined key, it defines an absolute key name. The predefined key names are:
Name Meaning
HKCR HKEY_CLASSES_ROOT
HKCC HKEY_CURRENT_CONFIG
HKCU HKEY_CURRENT_USER
HKLM HKEY_LOCAL_MACHINE
HKU HKEY_USERS
HKPD HKEY_PERFORMANCE_DATA
HKDD HKEY_DYN_DATA
Otherwise, keyname defines a sub key of Regkey.


Returns

If the registry key specified by the keyname parameter has been successfully opened, a new instance of the RegKey object is created. Otherwise, returns null.


Example

r = RegKey.open("HKCU\\Software\\Demo1");
sub = r.open("subkey");
sub2 = RegKey.open("subkey");
//returns null because "subkey" has no root.




Copyright ©2000-2010 Shanghai TopCMM Software Technologies. All Rights Reserved.