Esempio n. 1
0
        private void EndGame()
        {
            string now    = DateTime.Now.ToString("dd/MM/yy H:mm:ss");
            Info   person = new Info(Gameplay.Username, Gameplay.UserScore, Gameplay.Level, now);

            if (File.Exists("persons.xml"))
            {
                string input    = WorkWithFile.SimpleRead1();
                string inputxml = WorkWithFile.Decrypt(input, "HelloWorld");
                WorkWithFile.SimpleWrite1(inputxml);
            }

            Info[] from    = WorkWithFile.SimpleRead();
            Info[] persons = { person };
            if (from[0] != null)
            {
                persons = new Info[from.Length + 1];
                for (int i = 0; i < persons.Length - 1; i++)
                {
                    persons[i] = from[i];
                }
                persons[persons.Length - 1] = person;
            }

            WorkWithFile.SimpleWrite(persons);
            string output    = WorkWithFile.SimpleRead1();
            string outputxml = WorkWithFile.Encrypt(output, "HelloWorld");

            WorkWithFile.SimpleWrite1(outputxml);

            var w1 = new ResultTable();

            w1.Show();
            Close();
        }
        private void EndGame()
        {
            string now = DateTime.Now.ToString("dd/MM/yy H:mm:ss");
            Info person = new Info(Gameplay.Username,Gameplay.UserScore,Gameplay.Level,now);

            if (File.Exists("persons.xml"))
            {
                string input = WorkWithFile.SimpleRead1();
                string inputxml = WorkWithFile.Decrypt(input, "HelloWorld");
                WorkWithFile.SimpleWrite1(inputxml);
            }

            Info[] from = WorkWithFile.SimpleRead();
            Info[] persons={person};
            if (from[0] != null)
            {
                persons = new Info[from.Length + 1];
                for (int i = 0; i < persons.Length - 1; i++)
                {
                    persons[i] = from[i];
                }
                persons[persons.Length - 1] = person;
            }

            WorkWithFile.SimpleWrite(persons);
            string output = WorkWithFile.SimpleRead1();
            string outputxml = WorkWithFile.Encrypt(output, "HelloWorld");
            WorkWithFile.SimpleWrite1(outputxml);

            var w1 = new ResultTable();
            w1.Show();
            Close();
        }
Esempio n. 3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var w1 = new ResultTable();

            w1.Show();
        }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     var w1 = new ResultTable();
     w1.Show();
 }