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();
        }
    }  
    
  • 相关阅读:
    四、Signalr手持令牌验证
    三、Signalr外部链接
    三、使用Fiddler劫持网络资源(手机端)
    一、数据库层搭建
    学会聊天
    weblogic实时监控开发
    jrockit静默安装笔记
    自动磁盘分区脚本
    WebsphereMQ搭建集群
    Websphere MQ Cluster
  • 原文地址:https://www.cnblogs.com/wesson2019-blog/p/14158323.html
Copyright © 2011-2022 走看看