Esempio n. 1
0
        private void fmUpdate_Load(object sender, EventArgs e)
        {
            string res = CheckVersion("0");
            UpdateActivity upac = new UpdateActivity(null, res);
            if (upac.act == 0)
            {
                MessageBox.Show("You are using lastest version.");
                this.Close();
                return;
            }
            else
                if (upac.act == 1)
                {
                    if (MessageBox.Show("New version " + upac.lastestVersion + " is available. Do you want to download it", "Update is available", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
                    {
                        btDownload.Text = "Cancel Download";
                        this.Visible = false;

                        client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted);
                        client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged);
                        if (Utility.IsFileExist(setup_path))
                        {
                            try
                            {
                                System.IO.File.Delete(setup_path);
                            }
                            catch
                            { }
                        }
                        //if (Utility.IsFileExist("Setup_free.exe"))
                        //{
                        //    System.IO.File.Delete("Setup_free.exe");
                        //}
                        //if (AppConst.appType == RegisterType.Ads)
                        //    client.DownloadFileAsync(new Uri("http://tvking.tv/Setup_free.exe"), "Setup_free.exe");
                        //else if (AppConst.appType == RegisterType.Trial ||
                        //    AppConst.appType == RegisterType.Hours ||
                        //    AppConst.appType == RegisterType.Free)
                        client.DownloadFileAsync(new Uri("http://tvking.tv/Setup.exe"), setup_path);
                    }
                    else
                    {
                        this.Close();
                    }
                }
        }
Esempio n. 2
0
 private void updateToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     string res = fmUpdate.CheckVersion("0");
     UpdateActivity upac = new UpdateActivity(this, res);
     //fmupdate = new fmUpdate(this);
     //fmupdate.Show();
 }
Esempio n. 3
0
 private void InitCheckVersion()
 {
     string res = fmUpdate.CheckVersion("1");
     UpdateActivity upac = new UpdateActivity(this, res);
 }