zoukankan      html  css  js  c++  java
  • regedit注册表

    using Microsoft.Win32;

    StartMenu、控制面板删除安装信息

    // HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall
    var subKey = @"SOFTWAREMicrosoftWindowsCurrentVersionUninstall";
    var ndpKey = Registry.LocalMachine.OpenSubKey(subKey);
    if (ndpKey != null)
    {
        var rslt = ndpKey.OpenSubKey(oldProductCode, true);
        if (rslt != null)
        {
            foreach (var item in rslt.GetValueNames())
            {
                rslt.DeleteValue(item, true);
            }
            rslt.Close();
        }
    }                    
    // HKEY_CLASSES_ROOT/Installer/Products
    subKey = @"InstallerProducts";
    ndpKey = Registry.ClassesRoot.OpenSubKey(subKey);
    if (ndpKey != null)
    {
        var rslt = ndpKey.OpenSubKey(oldProductCode);
        if (rslt != null)
        {
            foreach (var item in rslt.GetValueNames())
            {
                rslt.DeleteValue(item, true);
            }
            rslt.Close();
        }
    }                
    // HKEY_CURRENT_USER/Software/Microsoft/Installer/Products
    subKey = @"SoftwareMicrosoftInstallerProducts";
    ndpKey = Registry.CurrentUser.OpenSubKey(subKey);
    if (ndpKey != null)
    {
        var rslt = ndpKey.OpenSubKey(oldProductCode);
        if (rslt != null)
        {
            foreach (var item in rslt.GetValueNames())
            {
                rslt.DeleteValue(item, true);
            }
            rslt.Close();
        }
    }  
    
  • 相关阅读:
    nyoj 42 一笔画 欧拉通路
    布丰投针实验1
    poj 1328 贪心
    uva 10026 贪心
    zoj 1375 贪心
    uva 103 经典DAG变形
    uva 11088 暴力枚举子集/状压dp
    jsp分页功能
    static静态变量的理解
    Vector & ArrayList 的主要区别
  • 原文地址:https://www.cnblogs.com/wesson2019-blog/p/14158323.html
Copyright © 2011-2022 走看看