Example #1
0
        static void LoadContacts()
        {
            string jsonread = string.Empty;
            string filename = "contacts.con";

            Console.WriteLine("Odczyt z pliku...");

            try
            {
                if (File.Exists(filename))
                {
                    byte[] fileEncrypted = File.ReadAllBytes(filename);
                    jsonread = Global.aes.Decrypt(fileEncrypted);
                }
            }
            catch (Exception e)
            {
                Global.Contacts = JsonHelp.DeserializeContacts("");
            }
            Global.Contacts = JsonHelp.DeserializeContacts(jsonread);
        }