AppEnv.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using SysBaseLib.Security;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace SysBaseLibs.Security
  8. {
  9. public class AppEnv
  10. {
  11. public static DBConfig ReadConnectionConfig()
  12. {
  13. return new DBConfig(FileFuns.ReadEncryptedFile("RSDB.cfg", "qwertyuiopasdfgh"));
  14. }
  15. public static string ConfigFile
  16. {
  17. get
  18. {
  19. //string text1 = LocalPath + "Config.rsc";
  20. string text1 = "Config.rsc";
  21. string text2 = FileFuns.GetFullPathFileName(text1);
  22. if (text2 != "")
  23. {
  24. text1 = text2;
  25. }
  26. else
  27. text1 = LocalPath + "\\bin\\Config.rsc";
  28. return text1;
  29. }
  30. }
  31. public static string LocalPath
  32. {
  33. get { return AppDomain.CurrentDomain.BaseDirectory; }
  34. }
  35. }
  36. }