| Package com.ms.lang |
Previous |
Microsoft Packages |
Index |
Next |
public class RegKey
{
// Fields
public final static int KEYOPEN_READ = 1;
public final static int KEYOPEN_WRITE = 2;
public final static int KEYOPEN_ALL = 3;
public final static int KEYOPEN_CREATE = 4;
public final static int CLASSES_ROOT = 1;
public final static int LOCALMACHINE_ROOT = 2;
public final static int USER_ROOT = 3;
public final static int USERS_ROOT = 4;
// Constructor
public RegKey(RegKey rkParent, String subKey, int access);
// Methods
public void finalize();
public void close();
public void deleteSubKey(String sub);
public void deleteValue(String val);
public RegKeyEnumValue enumValue(int idx);
public String enumKey(int idx);
public void flush();
public void loadKey(String subKey, String fileName);
public String getStringValue(String name);
public byte[] getBinaryValue(String name);
public int getIntValue(String name);
public void replace(String subKey, String newFile, String oldFile);
public void restore( String filename, boolean vol );
public void setValue(String subKey, String val);
public void setValue(String subKey, byte val[]);
public void setValue(String subKey, int val);
public void unload(String subKey);
public RegQueryInfo queryInfo();
}
This class produces registry access objects.
See also Class RegKey.
public RegKey(RegKey rkParent, String subKey, int access);Creates the specified key. If the key already exists in the registry, the function opens it.
Return Value:
Returns the newly created registry key.
Parameter Description rk Identifies a currently open key or any of the following predefined reserved handle values:
null HKEY_CLASSES_ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE HKEY_USERS The key created is a subkey of the key identified by the rk parameter. If the applet is running in a browser, or other protected environment, this parameter must be null. This specifies that the key will be created in a "sandboxed" section of the registry.
subKey Address of a string specifying the name of a subkey that this function opens or creates. The subkey specified must be a subkey of the key identified by the rk parameter. This subkey must not begin with the backslash character ('\'). This parameter cannot be null. access Access priveleges for the key, which can include the following: Throws:
SecurityException if the parent key is not accessible.
IOException if the key can not be created.
public void finalize()Cleans up the registry key, closing it if open.
Return Value:
No return value.
public void close()Closes the registry key.
Return Value:
No return value.
Remarks:
Use close when the key is no longer needed. This ensures that the system registry keys are written to disk. After closing, the key must not be used again.
public void deleteSubKey(String sub)Removes a subkey from the key.
Return Value:
No return value.
Parameter Description sub Subkey to be removed. Throws:
IOException if unsuccessful.
public void deleteValue(String val)Deletes a value from the key.
Return Value:
No return value.
Parameter Description val Name of the value to be deleted.
public RegKeyEnumValue enumValue(int idx)Enumerates subvalues of the key.
Return Value:
Returns the value of the provided index.
Parameter Description idx Index of the enumeration.
public String enumKey(int idx)Enumerates subkeys of the key.
Return Value:
Returns the name of the subkey.
Parameter Description idx Index of the enumeration.
public void flush()Flushes the key to the registry on disk.
Return Value:
No return value.
public void loadKey(String subKey, String fileName)Loads a new hive into the registry.
Parameter Description subKey Name of the subkey to be created to contain the new hive. fileName Name of a file to contain the registry information.
public String getStringValue(String name)Retrieves a string value from the registry. The name is a subkey of the current key.
Return Value:
Returns a string value contained in the subkey.
Parameter Description name Name of the subkey containing the value to be returned.
public byte[] getBinaryValue(String name)Retrieves a byte array from the registry. The name is a subkey of the current key.
Return Value:
Returns the byte array contained in the subkey.
Parameter Description name Name of the subkey containing the value to be returned.
public int getIntValue(String name)Retrieves an integer value from the registry. The name is a subkey of the current key.
Return Value:
Returns the integer value contained in the subkey.
Parameter Description name Name of the subkey containing the value to be returned.
public void replace(String subKey, String newFile, String oldFile)Replaces the file backing a key and all its subkeys with another file, so that when the system is next started, the key and subkeys will have the values stored in the new file.
Return Value:
No return value.
Parameter Description subKey Name of the subkey to be replaced. newFile Name of the file to contain the new values. oldFile Name of the file to receive a backup copy of the old values.
public void restore(String filename, boolean vol)Restores a subkey from a file.
Return Value:
No return value.
Parameter Description filename Name of the file containing the subkey. vol True if the hive is to be volatile.
public void setValue(String subKey, String val)Sets a string value into a subkey.
Return Value:
No return value.
Parameter Description subKey Subkey to hold the value. val String value to write out.
public void setValue(String subKey, byte val[])Sets a byte array into a subkey.
Return Value:
No return value.
Parameter Description subKey Subkey to hold the value. val Array to write out.
public void setValue(String subKey, int val)Sets an integer value into a subkey.
Return Value:
No return value.
Parameter Description subKey Subkey to hold the value. val Integer value to write out.
public void unload(String subKey)Unloads a hive from the registry.
Return Value:
No return value.
Parameter Description subKey Subkey to unload.
public RegQueryInfo queryInfo()Retrieves information about the key.
Return Value:
Returns a RegQueryInfo object which contains the information.
| © 1997 Microsoft Corporation. All rights reserved. Terms of Use. |