Exemplo n.º 1
0
        public RegHive(string regPath, subKey sk = null)
        {
            hivePath = regPath;
            if (null != sk)
            {
                sbkey = sk;
            }
            subKeys = RegHelper.GetSubKeys(regPath);
            int cnt = 0;

            foreach (string sub in subKeys)
            {
                string fullpath = hivePath + "\\" + sub;

                if (cnt % 500 == 0)
                {
                    Controller.UpdateProgress("Reading (" + cnt + ") " + fullpath, false);
                    //If closing
                    if (Controller.shouldAbort)
                    {
                        return;
                    }
                }
                cnt++;

                RegKey rk = new RegKey(fullpath, "");
                regKeys.Add(rk);

                if (sk != null)
                {
                    string fullpath2 = fullpath + "\\" + sk.subPath;
                    string result    = RegHelper.GetValueForProperty(fullpath2, sk.property);
                    if (!string.IsNullOrEmpty(result))
                    {
                        if (propertyMap.ContainsKey(result))
                        {
                            propertyMap[result].Add(fullpath);
                        }
                        else
                        {
                            propertyMap.Add(result, new List <string> {
                                fullpath
                            });
                        }
                    }
                } //if sk not null
            }
        }         //ctor
Exemplo n.º 2
0
 public LoadRegHive(string s, subKey subk)
 {
     key = s;
     sk  = subk;
 }