Ejemplo n.º 1
0
        public static CloudClient GetClientFromEncryption()
        {
            var bytes   = File.ReadAllBytes("UserData\\Account");
            var json    = Endecryption.Decrypt(bytes);
            var account = JsonSerializer.Deserialize <AccountInfo>(json, JsonOptions);
            var client  = Create(account.UserName, account.Password, account.CloudType);

            client.LastSyncTime = account.LastSyncTime;
            return(client);
        }
Ejemplo n.º 2
0
        public override void SaveEncyptedAccount()
        {
            var account = new AccountInfo()
            {
                CloudType    = CloudType.Jianguoyun,
                UserName     = UserName,
                Password     = Password,
                LastSyncTime = LastSyncTime
            };
            var json  = JsonSerializer.Serialize(account, JsonOptions);
            var bytes = Endecryption.Encrypt(json);

            File.WriteAllBytes("UserData\\Account", bytes);
        }