Exemplo n.º 1
0
        public static void Encrypt(object fieldObj)
        {
            if (fieldObj == null)
            {
                return;
            }
            ServiceObject serviceObject = new ServiceObject(fieldObj);
            string        data          = serviceObject.GetValue("__encrypted") as string;

            if (StringUtil.IsEmptyString(data) || !(data == "false"))
            {
                return;
            }
            serviceObject.SetValue("__encrypted", (object)"true");
            string            strMessage        = serviceObject.GetValue("Value") as string;
            RC2StringProvider rc2StringProvider = new RC2StringProvider();

            serviceObject.SetValue("Value", (object)rc2StringProvider.Encrypt("{8700F239-6C00-43e9-BA57-F2393B34D1DA}", strMessage));
        }