using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Net;using System.IO;namespace Authenticate{ public partial class Authenticate : Form { public Authenticate() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { int serverV; serverV = Convert.ToInt32(TBserver.Text); serverV = int.Parse(TBserver.Text); int localV; localV = Convert.ToInt32(TBlocal.Text); localV = int.Parse(TBlocal.Text); if (serverV > localV) { //DO THE UPDATE CODE } else { //DO NOT DO THE UPDATE CODE } } private void Authenticate_Load(object sender, EventArgs e) { WebClient Client = new WebClient(); Client.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed); Client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged); Client.DownloadFileAsync(new Uri("http://98.118.57.8/anti/version.txt"), "versionS.txt"); } private void ProgressChanged(object sender, DownloadProgressChangedEventArgs e) { //progressBar1.Value = e.ProgressPercentage; } private void Completed(object sender, AsyncCompletedEventArgs e) { StreamReader SRlocal = new StreamReader("versionL.txt");TBlocal.Text = SRlocal.ReadToEnd();SRlocal.Close();StreamReader SLserver = new StreamReader("versionS.txt");TBserver.Text = SLserver.ReadToEnd();SLserver.Close(); }//what ever to do after completed }}