Beispiel #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            String[] names  = { "Licence.txt" };
            String   notice = ProgramHelper.CheckFiles(names);

            if (notice.Length > 0)
            {
                if (MessageBox.Show(notice + "\n点击确定跳到下载页面", "缺少必要的文件", MessageBoxButtons.OKCancel, MessageBoxIcon.Error) == DialogResult.OK)
                {
                    System.Diagnostics.Process.Start("http://vdhelper.sinaapp.com");
                }
                this.Close();
            }
            Version ApplicationVersion = new Version(Application.ProductVersion);

            currentVersion.Text = "当前版本:V" + ApplicationVersion.Major + "." + ApplicationVersion.Minor;
            this.Text           = this.Text + " V" + ApplicationVersion.Major + "." + ApplicationVersion.Minor;
            if (!Properties.Settings.Default.isAgree)
            {
                if (new ReadLicence().ShowDialog() == DialogResult.OK)
                {
                }
                else
                {
                    Close();
                }
            }
        }
Beispiel #2
0
 private void updateChecker_DoWork(object sender, DoWorkEventArgs e)
 {
     try
     {
         String[] updateInfo = ProgramHelper.UpdateCheck().Split(',');
         int      number     = int.Parse(updateInfo[1]);
         if (number > ProgramHelper.number)
         {
             updateChecker.ReportProgress(100, updateInfo);
         }
     }
     catch
     {
     }
 }