Пример #1
0
        void updater_DoWork(object sender, DoWorkEventArgs e)
        {
            UpdateCheck check = new UpdateCheck();
            try
            {
                HttpControl http = new HttpControl();
                string response = http.Get("http:" + "//2pix-steganography.googlecode.com/svn/trunk/setup.iss");

                check.LatestVersion = Regex.Match(response, @"AppVersion\=(?<version>[0-9\.]*)").Groups["version"].Value.Trim();
                check.UpdateURL = Regex.Match(response, @"AppUpdatesURL\=(?<url>.*)").Groups["url"].Value.Replace("\n", "").Replace("\n", "");
                check.MyVersion = GetCurrentVersion().Trim();
                check.Success = check.MyVersion != "" && check.LatestVersion != "";
            }
            catch
            {
                check.Success = false;
            }
            e.Result = check;
        }