I need calculate md5 for each file in UNC folder (\\192.168.1.3\ABC). The problem is this folder has large number of files (~2000 files) This code below take me 2,5 hours to finish.
foreach (var file in filesInFolder)
{
using (var md5 = MD5.Create())
{
using (var stream = File.OpenRead(file))
{
var md5Check = BitConverter.ToString(md5.ComputeHash(stream)).Replace("-", "").ToLower();
dicMD5[file] =md5Check;
}
}
}
if ABC is local folder it takes about 5 mins to complete this code above. I think i need some help for better approach. Please help me thanks alot