コード例 #1
0
        private static string _GetMD5Value(MD5Kind kind, ILogging logger, string[] lines)
        {
            string key = lines.FirstOrDefault(l => l.StartsWith(kind.ToString()));

            if (key == null)
            {
                logger.WriteLog(ErrorCodes.LocalDirectorySource_InvalidMD5File,
                                ErrorResources.LocalDirectorySource_InvalidMD5File,
                                Severity.Error, VerboseLevel.User);
                return(null);
            }

            return(key.Replace(kind.ToString() + ":", ""));
        }
コード例 #2
0
 public static string GetMD5FromFile(string md5File, MD5Kind kind, ILogging logger)
 {
     string[] lines = File.ReadAllLines(md5File);
     return(_GetMD5Value(kind, logger, lines));
 }
コード例 #3
0
 public static string GetMD5FromString(string data, MD5Kind kind, ILogging logger)
 {
     string[] lines = data.Split(Environment.NewLine);
     return(_GetMD5Value(kind, logger, lines));
 }