示例#1
0
 private void button2_Click(object sender, EventArgs e)
 {
     textBox8.Text = "";
     textBox9.Text = "";
     textBox7.Text = "";
     test          = null;
 }
示例#2
0
        private void button5_Click(object sender, EventArgs e)
        {
            XmlSerializer formatter = new XmlSerializer(typeof(Xml2CSharp.Test));

            if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            string filename = openFileDialog1.FileName;

            using (FileStream fs = new FileStream(filename, FileMode.OpenOrCreate))
            {
                test = (Xml2CSharp.Test)formatter.Deserialize(fs);
            }
            textBox8.Text = test.TestName;
            textBox9.Text = test.Author;
            textBox7.Text = test.Qty_questions;
        }