Example #1
0
        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            Guid guid = Guid.NewGuid();

            string[] temp = guid.ToString().Split('-');
            string   uuid = "";

            for (int i = 0; i < temp.Length; i++)
            {
                uuid += temp[i];
            }

            string rawData = "0/0/3/000\n1 / 0 / 4 / 000\n2 / 0 / 4 / 370\n3 / 0 / 4 / 730\n3 / 0 / 5 / 450\n2 / 0 / 5 / 600\n0 / 0 / 5 / 860\n1 / 0 / 6 / 100\n2 / 0 / 6 / 250\n0 / 0 / 6 / 550\n0 / 0 / 6 / 800\n2 / 0 / 7 / 270\n1 / 0 / 7 / 750\n3 / 0 / 9 / 130\n0 / 0 / 9 / 720\n2 / 0 / 10 / 140\n1 / 0 / 10 / 205\n4 / 0 / 10 / 500\n0 / 0 / 11 / 020\n4 / 0 / 11 / 500\n3 / 0 / 12 / 000\n4 / 0 / 12 / 200";
            string output  = uuid + AES256_manager.encrypt(rawData, uuid);

            writer.Write(output);
            writer.Close();
        }
Example #2
0
        public NoteManager(string musicName)
        {
            data = new Dictionary <int, MinData>();
            string musicPath = Program.musicFileDir + musicName + ".mlr";

            if (File.Exists(musicPath))
            {
                StreamReader reader = new StreamReader(musicPath);

                string rawData = reader.ReadLine();
                reader.Close();
                string key = rawData.Substring(0, 32);
                rawData = rawData.Substring(32);

                string[] line = AES256_manager.decrypt(rawData, key).Split('\n');
                int      temp = 0;
                foreach (string currentLine in line)
                {
                    string[] data = currentLine.Split('/');

                    try
                    {
                        int lineNum = Int32.Parse(data[0]);
                        int min     = Int32.Parse(data[1]);
                        int sec     = Int32.Parse(data[2]);
                        int ms      = Int32.Parse(data[3]);

                        ++temp;
                        addData(lineNum, min, sec, ms);
                    }
                    catch (FormatException) { }
                }

                noteCount = temp;
            }
            else
            {
                throw new Exception();
            }
        }