Exemple #1
0
        /// <summary>
        /// 刪除註冊表機碼
        /// </summary>
        private void DeleteKeyInRegistry()
        {
            RegistryKey RegistryProduct = Registry.LocalMachine.CreateSubKey(RegistryPath);

            if (RegistryProduct == null)
            {
                return;
            }

            if (RegistryProduct.ExistKey(m_RegistrySN))
            {
                RegistryProduct.DeleteValue(m_RegistrySN);
            }

            if (RegistryProduct.ExistKey(m_RegistryInstallDate))
            {
                RegistryProduct.DeleteValue(m_RegistryInstallDate);
            }

            RegistryProduct.Close();
        }