mirror of
https://github.com/JDM170/file_hash_checker
synced 2025-12-10 16:17:18 +07:00
Update Program.cs
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user