public Update(string curVersion,VersionInfo newVersion) { InitializeComponent(); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; labelOld.Text = curVersion; labelNew.Text = newVersion.Version; linkInstr.Text = newVersion.IntroductionUrl; linkDownload.Text = newVersion.DownloadUrl; linkInstr.Click += linkInstr_Click; linkDownload.Click+=linkDownload_Click; }
void GetService() { try { var version = new VersionInfo() { Version=CurentVersion}; var newVersionStr = httpClass.HttpPost(NetUrl, "data=" + XmlSerializer.XMLSerialize<VersionInfo>(version)); newVersion = XmlSerializer.DeXMLSerialize<VersionInfo>(newVersionStr); if (newVersion.Version != version.Version) { this.Invoke(new EnableButtonCallBack(ShowBtnUpdate)); } thread.Abort(); } catch { } }