Esempio n. 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Text            = "当前第0页";
            button8.Enabled = false;
            button9.Enabled = false;
            Thread ddd = new Thread(downThread);

            ddd.IsBackground = true;
            ddd.Start();
            Directory.CreateDirectory($"{Application.StartupPath}\\temp");
            Directory.CreateDirectory($"{Application.StartupPath}\\down");
            XMLFiles xml = new XMLFiles($"{Application.StartupPath}\\set.xml");

            if (!xml.ExistINIFile())
            {
                xml.CreateXmlFile();
                xml.setXmlValue("重试次数", 基本设置.重试次数.ToString());
                xml.setXmlValue("重试毫秒", 基本设置.重试毫秒.ToString());
            }
            else
            {
                基本设置.重试次数 = Convert.ToInt32(xml.getXmlValue("基本设置", "重试次数"));
                基本设置.重试毫秒 = Convert.ToInt32(xml.getXmlValue("基本设置", "重试毫秒"));
            }
        }
Esempio n. 2
0
        private void Form2_Load(object sender, EventArgs e)
        {
            XMLFiles xml = new XMLFiles($"{Application.StartupPath}\\set.xml");

            if (!xml.ExistINIFile())
            {
                File.Create(xml.xmlName).Close();
                xml.setXmlValue("重试次数", 基本设置.重试次数.ToString());
                xml.setXmlValue("重试毫秒", 基本设置.重试毫秒.ToString());
            }
            textBox1.Text = xml.getXmlValue("基本设置", "重试次数");
            textBox2.Text = xml.getXmlValue("基本设置", "重试毫秒");
        }