using System; using System.Net; using System.Threading; namespace Launcher2 { public sealed class UpdateCheckTask : IWebTask { public const string UpdatesUri = "http://cs.classicube.net/"; StringComparison ordinal = StringComparison.Ordinal; public string LatestStableDate, LatestStableSize; public string LatestDevDate, LatestDevSize; public void CheckForUpdatesAsync() { Working = true; Exception = null; LatestStableDate = null; LatestStableSize = null; LatestDevDate = null; LatestDevSize = null; Thread thread = new Thread( UpdateWorker, 256 * 1024 ); thread.Name = "Launcher.UpdateCheck"; thread.Start(); } void UpdateWorker() { try { CheckUpdates(); } catch( WebException ex ) { Finish( false, ex, null ); return; } Finish( true, null, null ); } void CheckUpdates() { var response = GetHtml( UpdatesUri, UpdatesUri ); foreach( string line in response ) { if( line.StartsWith( @"