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
- {
- //The UI contains v1.1, so this should go to the else.
- 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);
- }
- //Great, this pops up. at the same time the messagebox pops up, the catch appears.
- 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"));
- }
- }
- }
- }
- //Wait a minute, if something in the try doesn't work the catch appears and the inside of the try doesn't occur.
- //Why did the inside of the catch occur then. This used to work until recently, but I haven't changed this file.
- 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