public static void Load(string path = "hashlist.txt") { if (!File.Exists(path)) { return; } file = path; dict = new Dictionary <ulong, string>(); using (var sr = new StreamReader(path)) { while (!sr.EndOfStream) { string name = sr.ReadLine(); ulong hash = FNV64.Hash(name); if (!FileHash.dict.ContainsKey(hash)) { FileHash.dict.Add(hash, name); } } } }
public static void Add(string name) { if (dict == null) { return; } if (ResourceExplorer.Helpers.IsFileLocked(new FileInfo(file)) == false) { ulong hash = FNV64.Hash(name); if (!dict.ContainsKey(hash)) { using (var sw = new StreamWriter(file, true)) { sw.WriteLine(name); } } } }