Пример #1
0
        public Task <string> Ls(string disk, string path)
        {
            return(Task.Run(() =>
            {
                var process = CreateProcess(LsArgument(disk, path));
                process.Start();

                process.StandardInput.WriteLine(_password.Get());
                var output = process.StandardOutput.ReadToEnd();

                process.WaitForExit();
                return output;
            }));
        }
Пример #2
0
 public void Save(PasswordStore password)
 {
     using (var sw = new StreamWriter(ConfigFile))
     {
         sw.WriteLine(
             StringCipher.Encrypt(JsonConvert.SerializeObject(this), password.Get())
             );
     }
 }
Пример #3
0
        private static Config Deserialize(PasswordStore password)
        {
            if (!File.Exists(ConfigFile))
            {
                return(new Config());
            }

            var content  = File.ReadAllText(ConfigFile);
            var settings = JsonConvert.DeserializeObject <Config>(StringCipher.Decrypt(content, password.Get()));

            settings.AfterDeserialization();
            return(settings);
        }