zoukankan      html  css  js  c++  java
  • c# 注册表.代码示例.(迭代遍历注册表)[Demo]

    //z 2012-5-3 16:51:44 PM IS2120@CSDN 如果欲修改值,打开时如下:
    // RegistryKey skms = SoftwareKey.OpenSubKey(RegistryKeyName, true);
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.Win32;
     
    namespace regEnum
    {
        class Program
        {
            static void Main(string[] args)
            {
                string regPath = @"Control Panel";
                keyWalker walker = new keyWalker();
                walker.enumerateKeysRecurse(regPath);
                Console.ReadKey();
            }
        }
     
        class keyWalker
        {
            public void enumerateKeysRecurse(string keyPath)
            {
                RegistryKey HKLM = Registry.CurrentUser;
                RegistryKey RegKey = HKLM.OpenSubKey(keyPath);
                string[] subKeys = RegKey.GetSubKeyNames();
     
                foreach (string subKey in subKeys)
                {
                    string fullPath = keyPath + "\\" + subKey;
                    this.enumerateKeysRecurse(fullPath);
                    Console.WriteLine(fullPath);
                }
     
            }
        }
    }


  • 相关阅读:
    一次Access注入
    偏移注入
    DHCP协议
    ARP协议、ARP欺骗
    bWAPP_HTML Injection
    上网行为管理&云计算
    两个文件上传/包含
    SQL报错注入
    如何建立git 远程仓库
    PHP实现异步调用方法研究
  • 原文地址:https://www.cnblogs.com/IS2120/p/6745900.html
Copyright © 2011-2022 走看看