Exemplo n.º 1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(txtUserName.Text))
            {
                MessageBox.Show("Please enter a user name.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                string password  = txtPassword.Text;
                string plaintext = password;

                // Encrypt the password
                string encryptedstring = StringCipher.Encrypt(plaintext, password);
                //Console.WriteLine(encryptedstring);

                // Decrypt the password
                string decryptedstring = StringCipher.Decrypt(encryptedstring, password);
                //Console.WriteLine(decryptedstring);

                // Find userNamer in file
                //string result = XmlUtils.XmlSearch.searchXMLFileOriginal("..\\..\\Data\\", "Users.usr", "John");
                string result = XmlUtils.XmlSearch.searchXMLFileOriginal("..\\..\\Data\\", "booksort.xml", "admin");
                // Console.WriteLine("returned value: " + result);

                this.Hide();
                var selectTest = new SelectTest();
                selectTest.Closed += (s, args) => this.Close();
                selectTest.Show();
            }
        }
Exemplo n.º 2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            // This is how you call a non-static method, you instantiate the class
            // first into a local variable.  This is the traditional way of doing things
            Linq2Xml GetXMLQA = new Linq2Xml();

            GetXMLQA.GetQA();


            //numberOfQuestions = int.Parse(updTotalQuestions.Value.ToString());
            // Open new window frmAnser pass in numberOfQuestions

            this.Hide();
            var frmAnswer = new SelectTest();

            frmAnswer.Closed += (s, args) => this.Close();
            frmAnswer.Show();
        }