/// <summary>
///
/// </summary>
/// <param name="root"></param>
/// <param name="subKey"></param>
internal static void CreateKey(RegistryKey root, string subKey)
{
RegistryKey rk = null;
try {
rk = root.CreateSubKey( subKey );
if ( rk != null ) {
Log.AppendString( logfile, "Created key: " + rk.ToString() + Environment.NewLine );
Display.UpdateStatus( "Created: " + root.ToString() + "\\..." + subKey.Substring( subKey.LastIndexOf( '\\' ) ) + "\\*" );
}
}
catch ( Exception ex ) {
// Record exceptions in the log file
Log.AppendException( logfile, ex );
}
finally {
// Finally, cleanup and prepare variables for garbage collection
if ( rk != null ) {
rk.Close();
rk = null;
}
subKey = null;
}
}