/// <summary> 获得指定文件的Hash值 </summary>
/// <param name="filePath" type="string">文件路径</param>
/// <returns></returns>
public static string GetFileHash(string filePath)
{
var cpter = System.Security.Cryptography.MD5.Create();
return BitConverter.ToString(cpter.ComputeHash(System.IO.File.ReadAllBytes(filePath))).Replace("-", "").ToUpper();
}
转载于:https://www.cnblogs.com/zeroone/p/3259162.html