Просмотр исходного кода

Modified Executing Directory 3rd attempt

tags/jdis_osx
rpm-mcarman 3 лет назад
Родитель
Сommit
31f580d3d6
1 измененных файлов: 6 добавлений и 4 удалений
  1. +6
    -4
      Program.cs

+ 6
- 4
Program.cs Просмотреть файл

@@ -90,7 +90,8 @@ namespace jdis_import
list.Add(todo);
//Download File
FileAttachment fAttachment = attachment as FileAttachment;
File.WriteAllBytes(fAttachment.Name, fAttachment.Content);
string fileAttachmentPath = Path.Combine(_exeDir, fAttachment.FileName);
File.WriteAllBytes(fileAttachmentPath, fAttachment.Content);
msg.IsRead = true;
}
}
@@ -116,7 +117,7 @@ namespace jdis_import
else
{
body = string.Format(body, sendMsg.FileName, sendMsg.WorkOrder, string.Format("Had Errors while importing: {0}", sendMsg.Validation));
msgToSend.Attachments.AddFileAttachment(sendMsg.FileName);
msgToSend.Attachments.AddFileAttachment(Path.Combine(_exeDir, sendMsg.FileName)
}
@@ -125,8 +126,9 @@ namespace jdis_import
msgToSend.CcRecipients.Add(new EmailAddress("mcarman@rpmindustries.com"));
msgToSend.Body = body;
msgToSend.SendAndSaveCopy();
if (sendMsg.Success) File.Move(sendMsg.FileName, Path.Combine("Success", sendMsg.FileName));
else File.Move(sendMsg.FileName, Path.Combine("Fail", sendMsg.FileName));
string pathToFile = Path.Combine(_exeDir, sendMsg.FileName);
if (sendMsg.Success) File.Move(pathToFile, Path.Combine(_exeDir, "Success", sendMsg.FileName));
else File.Move(sendMsg.FileName, Path.Combine(_exeDir, "Fail", sendMsg.FileName));
}
}
catch (MsalException ex)


Загрузка…
Отмена
Сохранить