MD5

/// <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();
        }

posted on 2013-08-15 10:49  武胜-阿伟  阅读(225)  评论(0)    收藏  举报