WinSCP.cs 678 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace DecryptPwd.Utils
  7. {
  8. public class WinSCP
  9. {
  10. /// <summary>
  11. /// Decrypt password
  12. /// </summary>
  13. public static string Decrypt(string password)
  14. {
  15. string result = string.Empty;
  16. try
  17. {
  18. byte[] data = Convert.FromBase64String(password);
  19. result = Encoding.UTF8.GetString(data);
  20. }
  21. catch (Exception ex)
  22. {
  23. Console.WriteLine(ex.Message);
  24. }
  25. return result;
  26. }
  27. }
  28. }