コード例 #1
0
        public bool ProductIndexFile(string path, string version = "0.01")
        {
            var files    = Directory.GetFiles(path, "*.*", SearchOption.AllDirectories);
            var fileList = new List <string>(files);

            string text = "Version|" + version + "\r\n";

            foreach (var f in fileList)
            {
                var    hash = Sha1.CalcSHA1String(File.ReadAllBytes(f));
                string temp = "F:" + f.Replace(path, "") + "|hash:" + hash + "\r\n";
                text += temp;
            }

            File.WriteAllText(path + "/Index.txt", text);
            return(true);
        }