예제 #1
0
        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);
        }
예제 #2
0
        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);
        }