资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

C#获取文件的MD5码

public static string GetFileMD5(string FilePath)
        {
   try
            {
                FileStream get_file= new FileStream(FilePath, FileMode.Open, FileAccess.Read, FileShare.Read);
                System.Security.Cryptography.MD5CryptoServiceProvider get_md5= new System.Security.Cryptography.MD5CryptoServiceProvider();
       byte[] hash_byte = get_md5.ComputeHash(get_file);
       string resule = System.BitConverter.ToString(hash_byte);
                resule= resule.Replace("-", "");
                get_file.Close();
       return resule;
            }
   catch
            {
       return string.Empty;
            }
        }

网站栏目:C#获取文件的MD5码
本文网址:http://cdkjz.cn/article/gdogih.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220