GetValue Method (String, String, String, String)
Retrieve a string value from the profile using the supplied subkey for the given Driver ID and variable name. Set and return the default value if the requested variable name has not yet been set.

Namespace: ASCOM.Utilities
Assembly: ASCOM.Utilities (in ASCOM.Utilities.dll) Version: (


public string GetValue(
	string DriverID,
	string Name,
	string SubKey,
	string DefaultValue
Visual Basic
Public Function GetValue ( _
	DriverID As String, _
	Name As String, _
	SubKey As String, _
	DefaultValue As String _
) As String
Visual C++
virtual String^ GetValue(
	String^ DriverID, 
	String^ Name, 
	String^ SubKey, 
	String^ DefaultValue
) sealed


Type: System..::..String
ProgID of the device to read from
Type: System..::..String
Name of the variable whose value is retrieved
Type: System..::..String
Subkey from the profile root from which to read the value
Type: System..::..String
Default value to be used if there is no value currently set

Return Value

Retrieved variable value


IProfile..::..GetValue(String, String, String, String)


Name may be an empty string for the unnamed value. The unnamed value is also known as the "default" value for a registry key.

Does not provide access to other registry data types such as binary and doubleword.

If a default value is supplied and the value is not already present in the profile store, the default value will be set in the profile store and then returned as the value of the DriverID/SubKey/Name. If the default value is set to null (C#) or Nothing (VB) then no value will be set in the profile and an empty string will be returned as the value of the DriverID/SubKey/Name.


ASCOM.Utilities.Exceptions..::..InvalidValueExceptionThrown if DriverID is an empty string.
ASCOM.Utilities.Exceptions..::..DriverNotRegisteredExceptionThrown if the driver is not registered,

See Also