修复错误判断

This commit is contained in:
ZtRXR 2023-10-14 14:46:11 +08:00
parent 745d2e2b6c
commit 872644e47e

View File

@ -33,6 +33,8 @@ public class FileCopy
using(var fileInfoDb = new FileInfoDb())
{
foreach (var file in sourceDir.GetFiles())
{
try
{
string destinationFile = Path.Combine(desDir.FullName, file.Name);
var tryGetFileDbInfo = fileInfoDb.Files.Where(w => w.Path == destinationFile).FirstOrDefault();
@ -81,6 +83,10 @@ public class FileCopy
copyList.Add((file.Length, file, destinationFile, "NewFile"));
}*/
}catch(Exception ex)
{
Debug.WriteLine(ex.ToString());
}
}
fileInfoDb.SaveChanges();
}
@ -148,8 +154,14 @@ public class FileCopy
continue;
}
if (!desInfo.Directory.Exists)
{
try
{
desInfo.Directory.Create();
}catch(Exception ex)
{
Debug.WriteLine(ex.ToString());
}
}
try
{