可疑的英雄,幸福婚嫁网,张家界汽车站
通过system.security.cryptography.hashalgorithm 哈希算法获取文件的哈希值比较判断
public static bool comparefile(string filepath1, string filepath2) { //计算第一个文件的哈希值 hashalgorithm hash = hashalgorithm.create(); var stream_1 = new system.io.filestream(filepath1, system.io.filemode.open); byte[] hashbyte_1 = hash.computehash(stream_1); stream_1.close(); //计算第二个文件的哈希值 var stream_2 = new system.io.filestream(filepath2, system.io.filemode.open); byte[] hashbyte_2 = hash.computehash(stream_2); stream_2.close(); return bitconverter.tostring(hashbyte_1) == bitconverter.tostring(hashbyte_2); }
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Net Core Web Api项目与在NginX下发布的方法
asp.net core3.1 引用的元包dll版本兼容性问题解决方案
IdentityServer4实现.Net Core API接口权限认证(快速入门)
ASP.NET Core MVC通过IViewLocationExpander扩展视图搜索路径的实现
网友评论