Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private async void CheckVersion()
- {
- try
- {
- var client = new HttpClient();
- if (thisVersion < futureVersion)
- {
- var clientUpdater = new WebClient();
- clientUpdater.DownloadFileCompleted += Client_DownloadFileCompleted;
- clientUpdater.DownloadFileAsync(new Uri(@"http://taskbox.zzz.com.ua/TestViewer/TestViewer.exe"), "_temp.exe");
- }
- else
- {
- //сообщение о том, что у пользователя актуальная версия
- }
- }
- catch (Exception ex)
- {
- //сообщение об ошибке
- }
- }
- private void Client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
- {
- try
- {
- Process.Start("updater.exe", "_temp.exe TestViewer.exe");
- Process.GetCurrentProcess().Kill();
- }
- catch (Exception ex)
- {
- //сообщение об ошибке
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement