コード例 #1
0
        public static bool CitesteConturi(string path, string parola)
        {
            //Convertim din json
            var bkCaracterePermise = CaracterePermise;

            CaracterePermise = "ABCDEFHIJKLMNOPQRSTUVWXYZ1234567890";

            string tempFilePath = System.IO.Path.GetTempPath() + $"atomtemp{RandomString(8)}.atom";

            CaracterePermise = bkCaracterePermise;
            File.Copy(path, tempFilePath);
            try
            {
                Encriptie.DecryptFile(tempFilePath, MainPassword);

                string convertMe = File.ReadAllText(tempFilePath);
                File.Delete(tempFilePath);
                Cont.Conturi = JsonConvert.DeserializeObject <List <Cont> >(convertMe);
            }
            catch {
                if (File.Exists(tempFilePath))
                {
                    File.Delete(tempFilePath);
                }
                return(false);
            }
            return(true);
        }
コード例 #2
0
        public static void SalveazaParolele(string path, string pass)
        {
            string json = JsonConvert.SerializeObject(Cont.Conturi);

            File.WriteAllText(path, json);
            Encriptie.EncryptFile(path, pass);
        }