예제 #1
0
        private void getValue()
        {
            setXML xml = new setXML();

            xml.setXMLPathLocal("update.xml");
            this.txt_appdate.Value   = Convert.ToDateTime(xml.getSetXmlValue("appDate"));
            this.txt_appversion.Text = xml.getSetXmlValue("appVersion");
            this.txt_apppath.Text    = xml.getSetXmlValue("appPath");
            this.txt_appname.Text    = xml.getSetXmlValue("appName");
            this.txt_updateURL.Text  = xml.getSetXmlValue("updatePath");
        }
예제 #2
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            setXML xml = new setXML();

            xml.setXMLPathLocal("update.xml");
            xml.editxml("appVersion", this.txt_appversion.Text);
            xml.editxml("appDate", this.txt_appdate.Value.ToString("yyyy-MM-dd"));
            xml.editxml("appPath", this.txt_apppath.Text);
            xml.editxml("appName", this.txt_appname.Text);
            xml.editxml("updatePath", this.txt_updateURL.Text);
            MessageBox.Show("保存成功!");
        }
예제 #3
0
파일: Update.cs 프로젝트: starseac/Update
        private void btn_checkUpdate_Click(object sender, EventArgs e)
        {
            setUpdate update = new setUpdate();
            setXML    xml    = new setXML();

            xml.setXMLPathLocal("update.xml");
            update.setUpdatePar(xml.getSetXmlValue("updatePath"), xml.getSetXmlValue("updateIndexFile"));
            bool ans = update.checkNewUpdate(xml.getSetXmlValue("lastupdateDate"), xml.getSetXmlValue("lastupdateVersion"));

            string [] updateStr = update.getNewUpdate();
            if (ans == true)
            {
                MessageBox.Show("发现更新:" + updateStr[0] + "-v" + updateStr[1]);
            }
            else
            {
                MessageBox.Show("没有发现更新");
            }
        }
예제 #4
0
파일: Update.cs 프로젝트: starseac/Update
        private void btn_updateStart_Click(object sender, EventArgs e)
        {
            setUpdate update = new setUpdate();
            setXML    xml    = new setXML();

            xml.setXMLPathLocal("update.xml");
            update.setUpdatePar(xml.getSetXmlValue("updatePath"), xml.getSetXmlValue("updateIndexFile"));
            bool ans = update.checkNewUpdate(xml.getSetXmlValue("lastupdateDate"), xml.getSetXmlValue("lastupdateVersion"));

            string[] updateStr = update.getNewUpdate();
            if (ans == true)
            {
                //  MessageBox.Show("发现更新:" + updateStr[0] + "-v" + updateStr[1]);
                if (MessageBox.Show("发现更新:" + updateStr[0] + "-v" + updateStr[1] + ",更新,请点击确认按钮,不更新请点击取消按钮", "更新", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    update.startUpdate();
                    MessageBox.Show("更新完成!");
                }
            }
            else
            {
                MessageBox.Show("没有发现更新");
            }
        }