📜  自定义加密字符串类型 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:53.460000             🧑  作者: Mango

代码示例1
public class EncryptedString
{
    private readonly string _value;

    public EncryptedString(string value)
    {
        _value = value;
    }

    public static implicit operator string(EncryptedString s)
    {
        return s._value;
    }

    public static implicit operator EncryptedString(string value)
    {
        if (value == null)
            return null;

        return new EncryptedString(value);
    }
}