终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

82 lines
2.3 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace BPASmart.Model
  8. {
  9. public class FileConfigModel
  10. {
  11. public static string ConstPath { get; set; } = string.Empty;
  12. /// <summary>
  13. /// 变量配置路径
  14. /// </summary>
  15. public static string VarConfigPath
  16. {
  17. get
  18. {
  19. string ReturnValue = null;
  20. if (Directory.Exists(ConstPath))
  21. {
  22. string path = $"{ConstPath}\\{ConfigDirName}\\JSON";
  23. Directory.CreateDirectory(path);
  24. ReturnValue = $"{ConstPath}\\{ConfigDirName}\\JSON\\CommunicationPar.json";
  25. }
  26. return ReturnValue;
  27. }
  28. }
  29. /// <summary>
  30. /// 获取二进制文件配置路径
  31. /// </summary>
  32. /// <returns></returns>
  33. public static string GetBinConfigPath
  34. {
  35. get
  36. {
  37. string ReturnValue = null;
  38. if (Directory.Exists(ConstPath))
  39. {
  40. string path = $"{ConstPath}\\{ConfigDirName}\\{BaseConfig}";
  41. Directory.CreateDirectory(path);
  42. ReturnValue = $"{ConstPath}\\{ConfigDirName}\\{BaseConfig}\\{BinConfigFileName}";
  43. }
  44. return ReturnValue;
  45. }
  46. }
  47. /// <summary>
  48. /// 变量管理器路径
  49. /// </summary>
  50. public static string VarManagerPath => $"{AppDomain.CurrentDomain.BaseDirectory}BPASmart.VariableManager.exe";
  51. /// <summary>
  52. /// 页面文件夹名称
  53. /// </summary>
  54. public const string PageDirName = "Layouts";
  55. /// <summary>
  56. /// 配置文件文件夹名称
  57. /// </summary>
  58. public const string ConfigDirName = "AccessFile";
  59. /// <summary>
  60. /// 基本配置文件夹名称
  61. /// </summary>
  62. public const string BaseConfig = "Bin";
  63. /// <summary>
  64. /// 二进制配置文件名
  65. /// </summary>
  66. public const string BinConfigFileName = "BinConfigFile.ser";
  67. /// <summary>
  68. /// 图片文件夹名称
  69. /// </summary>
  70. public const string ImageDirName = "Images";
  71. }
  72. }