Advertisement
Guest User

Untitled

a guest
Dec 7th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.62 KB | None | 0 0
  1.            foreach(fileList file in parser.files)
  2.             {
  3.                 string absolutePath = file.name.Replace("/", "\\");
  4.  
  5.                 if (!filesInDirectory.Contains(AppDomain.CurrentDomain.BaseDirectory + absolutePath))
  6.                 {
  7.                     filesToDownLoad.Add(file.name);
  8.                 }
  9.                 else
  10.                 {              
  11.                     ExistingFile existingFile = new ExistingFile(file.name,GetCheckSum(file.name));
  12.                     FILE_ERR err = parser.DoesFileMatch(existingFile.fileName, existingFile.checkSum, existingFile.fileSize);
  13.                     if (err != FILE_ERR.FERR_OK)
  14.                     {
  15.                         switch (err)
  16.                         {
  17.                             case FILE_ERR.FERR_CHECKSUMMISMATCH:
  18.                             case FILE_ERR.FERR_SIZEMISMATCH:
  19.                                 {
  20.                                     filesToDownLoad.Add(file.name);
  21.                                 }
  22.                                 break;
  23.                             case FILE_ERR.FERR_NOFILEFOUND:
  24.                                 {
  25.                                     using (System.IO.StreamWriter writer = new System.IO.StreamWriter("dlErr.txt", true))
  26.                                     {
  27.                                         writer.WriteLine("Error Downloading %s, file does not exist in the patcher.", existingFile.fileName);
  28.                                     }
  29.                                 }
  30.                                 break;
  31.                         }
  32.                     }
  33.                 }
  34.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement