Beispiel #1
0
        private bool checkAndCreateFile(string fileName, byte[] orign)
        {
            var hashFile   = FileChecker.GetCheckSum(fileName);
            var hashServer = FileChecker.GetCheckSum(orign);

            if (!ModelFileInfo.UnsafeByteArraysEquale(hashFile, hashServer))
            {
                Loger.Log($"Create file {fileName}");
                if (File.Exists(fileName))
                {
                    File.Delete(fileName);
                }

                File.WriteAllBytes(fileName, orign);

                return(false);
            }

            Loger.Log($"Hash for the file {fileName} equal on the server");
            return(true);
        }