static public RegValue[] ImportFrom(string regFile) { var result = new List<RegValue>(); string content = System.IO.File.ReadAllText(regFile); var parser = new RegParser(); char[] delimiter = new[] { '\\' }; foreach (KeyValuePair<string, Dictionary<string, string>> entry in parser.Parse(content)) foreach (KeyValuePair<string, string> item in entry.Value) { string path = entry.Key; var regval = new RegValue(); regval.Root = GetHive(path); regval.Key = path.Split(delimiter, 2).Last(); regval.Name = item.Key; regval.Value = Deserialize(item.Value, parser.Encoding); if (regval.Value != null) result.Add(regval); } return result.ToArray(); }
static public RegValue[] ImportFrom(string regFile) { var result = new List <RegValue>(); string content = System.IO.File.ReadAllText(regFile); content = Regex.Replace(content, @"\r\n|\n\r|\n|\r", "\r\n"); var parser = new RegParser(); char[] delimiter = new[] { '\\' }; foreach (KeyValuePair <string, Dictionary <string, string> > entry in parser.Parse(content)) { foreach (KeyValuePair <string, string> item in entry.Value) { string path = entry.Key; var regval = new RegValue(); regval.Root = GetHive(path); regval.Key = path.Split(delimiter, 2).Last(); regval.Name = item.Key; regval.Value = Deserialize(item.Value, parser.Encoding); if (regval.Value != null) { result.Add(regval); } } } return(result.ToArray()); }