URMConfig.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 vStation.URMStationRelevant
  8. {
  9. public enum URMUserType
  10. {
  11. None,
  12. Admin,
  13. Client,
  14. }
  15. public class URMConfig
  16. {
  17. public static string RPCAddress { get; set; }
  18. public static URMUserType URMUserType { get; set; }
  19. public static string UserName { get; set; }
  20. public static string Pwd { get; set; }
  21. public static string Token { get; set; }
  22. public static string Code { get; set; }
  23. public static bool IsAutoLogin =>true;
  24. public static bool IsAcceptPrivacy => true;
  25. public static string ManagementURL { get; set; }
  26. public static string URMWorkingDirectory { get; set; }
  27. public static string StorageDirectory => Path.Combine(URMWorkingDirectory, "AppStorage");
  28. public static string StatesPath => Path.Combine(StorageDirectory, "states.dat");
  29. public static string ConfigPath=> Path.Combine(StorageDirectory, "config.conf");
  30. public static string StationVersionPath=> Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "StationVersion.txt");
  31. public static bool GetIsSingleMode()
  32. {
  33. if (File.Exists(StationVersionPath))
  34. {
  35. var txt = File.ReadAllText(StationVersionPath).Trim();
  36. return txt == "single";
  37. }
  38. return false;
  39. }
  40. public static bool LoginByDongle { get; internal set; }
  41. }
  42. }