Update Program.cs

Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
2025-04-20 22:48:27 +07:00
parent fe8c2af0ec
commit 61d57af6e5

View File

@@ -105,9 +105,9 @@ namespace file_hash_checker
if (Regex.IsMatch(toCompare, regexHash)) if (Regex.IsMatch(toCompare, regexHash))
result = hash == toCompare.ToLower(); result = hash == toCompare.ToLower();
else if (File.Exists(toCompare)) else if (File.Exists(toCompare))
if (toCompare.EndsWith(".md5")) if (toCompare.EndsWith(".txt") || toCompare.EndsWith(".md5"))
{ {
var fileData = File.ReadAllText(toCompare); string fileData = File.ReadAllText(toCompare);
Match match = Regex.Match(fileData, regexHash); Match match = Regex.Match(fileData, regexHash);
if (match.Success) if (match.Success)
result = hash == match.Value; result = hash == match.Value;