///
/// 获取文件MD5值内容 先MD5加密再转换utf-8
///
///
///
static public string getFileStreamMD5(string filePath)
{
string fileStream = “”;
MyLog.Default.Info(“开始读取:” + filePath);
try
{
using (FileStream fsRead = new FileStream(filePath, FileMode.Open))
{
int fsLen = (int)fsRead.Length;
byte[] heByte = new byte[fsLen];
int r = fsRead.Read(heByte, 0, heByte.Length);
MD5 md5 = new MD5CryptoServiceProvider();
byte[] output = md5.ComputeHash(heByte);
fileStream = BitConverter.ToString(output);
}
}
catch (Exception ex)
{
MyLog.Default.LogError(“读取结束——MD5内容报错为:” + ex.ToString());
MyLog.Default.Info(“读取结束——MD5内容报错为:” + filePath);
}
MyLog.Default.Info(“读取结束——MD5内容为:” + filePath);
return fileStream.Replace("-", “”);
}