public void CompareFiles() { foreach (ManagedFile patchFile in PatchFiles) { string fullpath = CurrentProfile.ClientFolder + patchFile.Basepath + patchFile.Filename; FileScanned(this, new ScanEventArgs(patchFile.Filename)); //Tells the form to update the progress bar var localFile = new ManagedFile(fullpath); localFile.ComputeHash(); if (patchFile.MyHash != localFile.MyHash) { downloadFiles.Add(localFile); localFile.Length = patchFile.Length; } } }
public void ScanClient() { string fullpath; if (IsNewClient()) { CreateNewClient(); } foreach (ManagedFile patchFile in PatchFiles) { fullpath = CurrentProfile.ClientFolder + patchFile.Basepath + patchFile.Filename; FileScanned(this, new ScanEventArgs(patchFile.Filename)); //Tells the form to update the progress bar ManagedFile localFile = new ManagedFile(fullpath); localFile.ComputeHash(); if (patchFile.MyHash != localFile.MyHash) { LocalFiles.Add(localFile); localFile.Length = patchFile.Length; _patchTotalSize += patchFile.Length; } } }