CurrentEnvironment.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using PTMIBase.Entity.Interfaces.Common;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Reflection;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.IO;
  9. namespace PTMedicalInsurance.Demo.Entity.Structs
  10. {
  11. struct CurrentEnvironment : ICurrentEnvironment
  12. {
  13. private string _path;
  14. public string Path
  15. {
  16. get
  17. {
  18. // 如果 _path 为空字符串,则返回当前程序集所在的目录
  19. if (string.IsNullOrEmpty(_path))
  20. {
  21. return System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
  22. }
  23. else
  24. {
  25. return _path;
  26. }
  27. }
  28. set
  29. {
  30. // 设置 _path 的值
  31. _path = value;
  32. }
  33. }
  34. public string Mac { get; set; }
  35. public string Ip { get; set; }
  36. public string SignNo { get; set; }
  37. public string MsgId { get; set; }
  38. public string URL { get; set; }
  39. }
  40. }