Project files for the Acumatica Import for United Rentals
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

38 lignes
1.4 KiB

  1. using System;
  2. using System.IO;
  3. using System.Reflection;
  4. namespace uri_import.FClasses
  5. {
  6. public class FileActions
  7. {
  8. public static string ExecFile
  9. {
  10. get
  11. {
  12. string execFile = Assembly.GetExecutingAssembly().Location;
  13. if (execFile.Contains("\\"))
  14. execFile = execFile.Substring(0, execFile.LastIndexOf("\\"));
  15. else
  16. execFile = execFile.Substring(0, execFile.LastIndexOf("/"));
  17. return execFile;
  18. }
  19. }
  20. public static string Attachments { get; set; }
  21. public static string Logs { get; set; }
  22. public static string Successes { get; set; }
  23. public static string Failures { get; set; }
  24. public static void MakeDirectories()
  25. {
  26. Attachments = Path.Combine(ExecFile, "attachments");
  27. Logs = Path.Combine(ExecFile, "logs");
  28. Successes = Path.Combine(ExecFile, "successes");
  29. Failures = Path.Combine(ExecFile, "failures");
  30. if (!Directory.Exists(Attachments)) Directory.CreateDirectory(Attachments);
  31. if (!Directory.Exists(Logs)) Directory.CreateDirectory(Logs);
  32. if (!Directory.Exists(Successes)) Directory.CreateDirectory(Successes);
  33. if (!Directory.Exists(Failures)) Directory.CreateDirectory(Failures);
  34. }
  35. }
  36. }