如何解决如何从List <KeyValuePair <byte [],string >>查找重复的键fileHashList = new List <KeyValuePair <byte [],string >>;
我对List<KeyValuePair<byte[],string>> fileHashList = new List<KeyValuePair<byte[],string>>();
的看法
foreach (string entry in results)
{
FileInfo fileInfo = new FileInfo(Path.Combine("DirectoryPath"),entry));
using (var md5 = MD5.Create())
{
using (var stream = File.OpenRead(fileInfo.FullName))
{
var hash = md5.ComputeHash(stream);
fileHashList.Add(new KeyValuePair<byte[],string>(hash,fileInfo.FullName));
}
}
}
我需要在此列表中找到所有重复的键。
我尝试了this,但在我的情况下不起作用,即使我拥有相同的键,我也得到了"Enumeration yielded no results"
!
让我知道是否需要其他数据 谢谢
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。