コード例 #1
0
        /// <summary>
        ///	Delete a value from the registry.
        /// </summary>
        public void DeleteValue(string value, bool shouldThrowWhenKeyMissing)
        {
            AssertKeyStillValid();
            AssertKeyNameNotNull(value);

            if (!IsWritable)
            {
                throw new UnauthorizedAccessException("Cannot write to the registry key.");
            }

            RegistryApi.DeleteValue(this, value, shouldThrowWhenKeyMissing);
        }
コード例 #2
0
        /// <summary>
        ///	Delete a value from the registry.
        /// </summary>
        public void DeleteValue(string name, bool throwOnMissingValue)
        {
            AssertKeyStillValid();

            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            if (!IsWritable)
            {
                throw new UnauthorizedAccessException("Cannot write to the registry key.");
            }

            RegistryApi.DeleteValue(this, name, throwOnMissingValue);
        }