private void checkUpdate() { try { WebClient client = new WebClient(); client.Headers.Add("User-Agent", "CensusUploader"); String response = client.DownloadString("https://api.github.com/repos/christophrus/CensusUploader/releases/latest"); GithubJson json = JsonConvert.DeserializeObject <GithubJson>(response); String currentVersion = Assembly.GetEntryAssembly().GetName().Version.ToString(); if (json.tag_name != "v" + currentVersion) { DialogResult result = MessageBox.Show(this, "There is a new version of CensusUploader available. Do you wanna open the download website?", "CensusUploader", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (result == DialogResult.Yes) { System.Diagnostics.Process.Start("https://github.com/christophrus/CensusUploader/releases/latest"); } } } catch { } }
/// <summary> /// /// </summary> /// <returns></returns> IEnumerator GetGithubCount() { string json_url = string.Format("https://api.github.com/users/{0}", Github_User); WWW w = new WWW(json_url); yield return(w); if (w.error == null) { //Debug.Log("Github: " + w.text); Github = GithubJson.CreateFromJson(w.text); foreach (bl_SocialCounterDisplay d in GithubDisplay) { d.SendCount(GithubFollowers()); } } else { Debug.LogWarning("Error: " + w.error); } }