/// <summary>
/// 获取指定文件的MD5码
/// </summary>
/// <param name="FilePath">文件路径</param>
 /// <returns>string</returns>
private string GetMd5(string FilePath)
    {
        byte[] data = File.ReadAllBytes(FilePath);
        System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
        byte[] result = md5.ComputeHash(data);
        string Md5str = BitConverter.ToString(result).Replace("-", "");
        return Md5str;
    }


http://hi.baidu.com/zck98530/blog/category/asp%2Enet

posted on 2007-01-06 00:13  mbskys  阅读(308)  评论(0)    收藏  举报