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.

39 lines
952 B

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Configuration;
  4. using System.Linq;
  5. using System.Text;
  6. namespace Swift.API.Common
  7. {
  8. public static class TPGetStatic
  9. {
  10. public static string ReadWebConfig(string key, string defVal)
  11. {
  12. try
  13. {
  14. return ConfigurationManager.AppSettings[key].ToString() == null ? defVal : ConfigurationManager.AppSettings[key].ToString();
  15. }
  16. catch (Exception ex)
  17. {
  18. return defVal;
  19. }
  20. }
  21. public static bool IsValidMobile(string mobile)
  22. {
  23. if (mobile.Length > 11)
  24. {
  25. return false;
  26. }
  27. //var prefix = "010";
  28. //var mobprefix = mobile.Substring(0, 3);
  29. //if (mobprefix != prefix)
  30. //{
  31. // return false;
  32. //}
  33. return true;
  34. }
  35. }
  36. }