Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void Form1_Load(object sender, EventArgs e)
- {
- updateClient();
- }
- private void updateClient()
- {
- WebClient wc = new WebClient();
- try
- {
- string UI = wc.DownloadString("http://files.enjin.com/98518/version.txt");
- if (UI.Contains("deactivate"))
- {
- Properties.Settings.Default.active = false;
- }
- else
- {
- if (Properties.Settings.Default.active == false)
- {
- MessageBox.Show("Reactivating VHROC");
- //loginToolStripMenuItem.Visible = true;
- }
- }
- if (Properties.Settings.Default.active == false)
- {
- MessageBox.Show("Deactivating VHROC");
- //loginToolStripMenuItem.Visible = false;
- Properties.Settings.Default.autoUserEnable = false;
- Properties.Settings.Default.CurrentUser = null;
- System.Diagnostics.Process.Start("http://vhr.enjin.com/vhroc");
- }
- if (UI.Contains("v1.2"))
- {
- //Only if you need verification. Disabled most of the time.
- //MessageBox.Show("VHROC is running on the latest version.", "Up to Date", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- else
- {
- if(Properties.Settings.Default.active == true)
- {
- if (MessageBox.Show("An update is available, would you like to update to version " + UI + "?", "New Version Available!", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
- {
- System.Diagnostics.Process.Start(wc.DownloadString("http://files.enjin.com/98518/update.txt"));
- }
- }
- }
- }
- catch
- {
- MessageBox.Show("For some reason the program cannot connect to VHR, this may be due to a couple of things:\n\n - Server Maintenance in which case you should try checking for updates in a couple of hours\n\n - You may not be connected to the internet.", "Update Check Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment