Fix Utils.SHA256CheckSum file handle not closed

This commit is contained in:
ChsBuffer
2021-03-31 17:28:18 +08:00
parent 268bdb7730
commit a33c2c3757

View File

@@ -105,7 +105,7 @@ namespace Netch.Utils
try
{
var sha256 = SHA256.Create();
var fileStream = File.OpenRead(filePath);
using var fileStream = File.OpenRead(filePath);
return sha256.ComputeHash(fileStream).Aggregate(string.Empty, (current, b) => current + b.ToString("x2"));
}
catch