en:code:data:registry
This is an old revision of the document!
Table of Contents
Registry
This object allows you to have access to the system's registry. It only works under Windows.
Functions
Registry
Constructor function.
Syntax
var myObject = new Registry();
Example
Create a Registry object.
var myObject = new Registry();
Methods
openKey
Opens a registry key.
Syntax
myObject.openKey(key, subkey);
Arguments
- key - (Key) the root key to use
- subkey - (string) the subkey to open
Returns
- (Registry) this Registry
Exceptions
- (OpenKeyError) unable to open the key
createKey
Creates a registry key.
Syntax
myObject.createKey(key, subkey);
Arguments
- key - (Key) the root key to use
- subkey - (string) the subkey to create
Returns
- (Registry) this Registry
Exceptions
- (CreateKeyError) unable to create the key
setValue
Sets the value of the current key.
Syntax
myObject.setValue(value, data);
Arguments
- value - (string) the value to write to
- data - (mixed) the data to write
Returns
- (Registry) this Registry
Exceptions
- (SetValueError) cannot set the value data
value
Returns the data contained in a registry value.
Syntax
myObject.value(value);
myObject.value();
Arguments
- value - (string) the value to read
Returns
- (mixed) the data contained in a registry value
Exceptions
- (FindValueError) cannot find the value to read
- (InvalidValueError) invalid value type
valueNames
Returns all the value names contained in the current key.
Syntax
myObject.valueNames();
Returns
- (array) an array containing all the value names contained in the current key
Exceptions
- (InvalidKeyError) unable to query informations about this key
keys
Returns all the keys contained in the current key.
Syntax
myObject.keys();
Returns
- (array) an array containing all the keys contained in the current key
Exceptions
- (InvalidKeyError) unable to query informations about this key
deleteValue
Deletes a value contained in the current key.
Syntax
myObject.deleteValue(value);
myObject.deleteValue();
Arguments
- value - (string) the value to delete
Returns
- (Registry) this Registry
Exceptions
- (InvalidKeyError) unable to delete the key
deleteKey
Deletes a registry key, or deletes the current key.
Syntax
myObject.deleteKey(key, subkey);
myObject.deleteKey();
Arguments
- key - (Key) the root key to use
- subkey - (string) the subkey to delete
Returns
- (Registry) this Registry
Exceptions
- (InvalidKeyError) unable to create the key
closeKey
Closes the current key.
Syntax
myObject.closeKey();
Returns
- (Registry) this Registry
Enumerations
Key
Root keys.
Values
- ClassesRoot: classes root
- CurrentConfig: current config
- CurrentUser: current user
- Users: users
- LocalMachine: local machine
en/code/data/registry.1295986294.txt.gz · Last modified: 2021/02/13 11:23 (external edit)