日期:2014-05-17 浏览次数:20432 次
//传入文件路径 private string getMD5(string path) { MD5CryptoServiceProvider get_md5 = new MD5CryptoServiceProvider(); FileStream get_file = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read); byte[] hash_byte = get_md5.ComputeHash(get_file); string result = BitConverter.ToString(hash_byte); result = result.Replace("-", ""); get_file.Close(); return result; }