private void frmV2_Load(object sender, EventArgs e) { //assign sort to list views lvProcesses.ListViewItemSorter = new ListViewColumnSorter(); try { Thread updateCheck = new Thread(new ThreadStart(checkForUpdates)); updateCheck.Start(); } catch (Exception ex) { } //check to see if /tray was passed if (Environment.CommandLine.Contains("/tray")) { System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(this.oneShot)); } //load saved mapping loadMappings(); //load processes refreshMapping(); selfinfo selfi = new selfinfo(); this.Text += " v" + selfi.AssemblyVersion; }
public void checkForUpdates() { try { selfinfo asm = new selfinfo(); System.Net.WebClient verFile = new System.Net.WebClient(); string sAvailableVer = verFile.DownloadString("http://www.computedsynergy.com/aps/meta/version.txt"); int availableVersion = Convert.ToInt32(sAvailableVer.Replace(".", "")); int currentVersion = Convert.ToInt32(asm.AssemblyVersion.Replace(".", "")); if (availableVersion > currentVersion) { setUpdatesAvailable(sAvailableVer); } else { checkingForUpdatesToolStripMenuItem.Text = "No updates available."; } } catch (Exception ex) { checkingForUpdatesToolStripMenuItem.Text = "No updates available."; } }