IRegistryKey.ReadDateTime

Syntax

ReadDateTime(ValueName: String): DateTime;

Parameters

ValueName - name of the parameter, which value must be obtained.

Description

The ReadDateTime method reads date and time from binary parameter in the registry without checking parameter availability. If the parameter with the ValueName name does not exist, an exception is thrown.

Example

Executing the example requires that the registry subkey HKEY_CURRENT_USER\Software\MyProject\Params contains a binary parameter with the Param1 name with value of date and time stored in it.

Sub Main;

Var

RegKey, SubKey: IRegistryKey;

d: DateTime;

Begin

RegKey := RegistryClass.CurrentUser;

SubKey := RegKey.OpenSubKey("Software\MyProject\Params", False);

If SubKey.ValueExists("Param1") Then

d := SubKey.ReadDateTime("Param1");

End If;

End Sub Main;

After executing the example the Param1 parameter is searched in the registry subkey HKEY_CURRENT_USER\Software\MyProject\Params. If the parameter exists, the value of date and time contained in this parameter is read into the "d" variable.

See also:

IRegistryKey