tangxu
2024-11-04 ebd031e3bed6c1cfddce8fc9b98f7f9e95fb9e32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace DPumpHydr.WinFrmUI.WenSkin.DLL
{
    public static class WenSkinHelper
    {
        /// <summary>
        /// string to bool
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static bool ToBool(this string value)
        {
            try
            {
                return Convert.ToBoolean(value);
            }
            catch { return false; }
        }
 
        /// <summary>
        /// string 解密
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static string ToAESDecrypt(this string value)
        {
            return AES.AesEnDe.AESDecrypt(value) ?? "";
        }
        
        /// <summary>
        /// string 加密
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static string ToAESEncrypt(this string value)
        {
            return AES.AesEnDe.AESEncrypt(value) ?? "";
        }
    }
}