示例#1
0
        /// <summary>
        /// Open and return the user's KPP configuration registry key,
        /// creating it if it does not already exist. Caller must make sure
        /// to close the returned value after use.
        /// </summary>
        public static RegistryKey GetOtcRegKey()
        {
            RegistryKey regKey = Registry.CurrentUser.CreateSubKey(Base.GetOtcRegKeyString());

            if (regKey == null)
            {
                throw new Exception("Unable to read or create the registry key HKCU\\" + Base.GetOtcRegKeyString() + ".");
            }
            return(regKey);
        }