コード例 #1
0
        public static void Save(string saveString)
        {
            SimplerAES   aes = new SimplerAES();
            string       s   = aes.Encrypt(saveString);
            FileStream   fs  = new FileStream("Content/SaveFile/Save.txt", FileMode.Truncate);
            StreamWriter sw  = new StreamWriter(fs);

            sw.WriteLine(s);
            sw.Close();
            fs.Close();
        }
コード例 #2
0
        public static string Load()
        {
            SimplerAES aes  = new SimplerAES();
            string     line = "";

            try
            {
                using (StreamReader reader = new StreamReader("Content/SaveFile/Save.txt"))
                {
                    line = reader.ReadLine();
                }
                line = aes.Decrypt(line);
            }
            catch { }
            return(line);
        }