获取文件md5的值
public static string GetFileMd5(string filePath)
{
byte[] bytes;
using (FileStream fileStream=new FileStream(filePath,FileMode.Open))
{
MD5 md5=new MD5CryptoServiceProvider();
bytes = md5.ComputeHash(fileStream);
}
StringBuilder stringBuilder=new StringBuilder();
foreach (var b in bytes)
{
stringBuilder.Append(b.ToString("x2"));
}
return stringBuilder.ToString();
}