C#获取文件MD5
public static string GetFileMD5(string filePath) { using (FileStream fs = new FileStream(filePath, FileMode.Open)) { System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider(); byte[] bytes = md5.ComputeHash(fs); StringBuilder sb = new StringBuilder(); for (int i = 0; i < bytes.Length; i++) { sb.Append(bytes[i].ToString("x2")); } return sb.ToString(); }