static void SaveMd5s(string md5Path, string protoDir) { MD5Check forSave = new MD5Check(); DirectoryInfo di = new DirectoryInfo(protoDir); FileInfo[] fis = di.GetFiles("*.proto"); foreach (FileInfo fi in fis) { string md5 = MD5Check.FileMD5(fi.FullName); forSave.md5s.Add(md5); } forSave.Save(md5Path); }
static List <string> GetChangedProtoPaths(string md5Path, string protoDir) { MD5Check check = MD5Check.GenFromFile(md5Path); MD5Check forSave = new MD5Check(); List <string> paths = new List <string>(); DirectoryInfo di = new DirectoryInfo(protoDir); FileInfo[] fis = di.GetFiles("*.proto"); foreach (FileInfo fi in fis) { string md5 = MD5Check.FileMD5(fi.FullName); if (!check.md5s.Contains(md5)) { paths.Add(fi.FullName); } forSave.md5s.Add(md5); } return(paths); }