纽威
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.

32 lines
799 B

3 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace NFine.Code
  7. {
  8. public class DBConnection
  9. {
  10. public static bool Encrypt { get; set; }
  11. public DBConnection(bool encrypt)
  12. {
  13. Encrypt = encrypt;
  14. }
  15. public static string connectionString
  16. {
  17. get
  18. {
  19. string connection = System.Configuration.ConfigurationManager.ConnectionStrings["NFineDbContext"].ConnectionString;
  20. if (Encrypt == true)
  21. {
  22. return DESEncrypt.Decrypt(connection);
  23. }
  24. else
  25. {
  26. return connection;
  27. }
  28. }
  29. }
  30. }
  31. }