Ejemplo n.º 1
0
        public static HashFunctionResult ComputeMD5Checksum(string path)
        {
            var hashFuncResult = new HashFunctionResult()
            {
                filePath = path
            };

            hashFuncResult = TryCompute(hashFuncResult);
            return(hashFuncResult);
        }
Ejemplo n.º 2
0
 private static HashFunctionResult TryCompute(HashFunctionResult hashFuncResult)
 {
     try
     {
         hashFuncResult.hashSum = HashFuncMD5(hashFuncResult.filePath);
         hashFuncResult.error   = new HashFunctionException("Без ошибок");
     }
     catch (Exception e)
     {
         hashFuncResult.hashSum = String.Empty;
         hashFuncResult.error   = new HashFunctionException("Сообщение ошибки: " + e.Message, e);
     }
     return(hashFuncResult);
 }