コード例 #1
0
        /// <summary>
        /// Download the latest NKHook from the github releases section
        /// </summary>
        public static void DownloadNKH()
        {
            Log.Output("Downloading latest NKHook5...");

            string git_Text = WebHandler.ReadText_FromURL(gitURL);

            if (!Guard.IsStringValid(git_Text))
            {
                Log.Output("Failed to read release info for NKHook5");
                return;
            }

            var gitApi = GitApi.FromJson(git_Text);

            foreach (var a in gitApi)
            {
                foreach (var b in a.Assets)
                {
                    string link = b.BrowserDownloadUrl.ToString();
                    if (!Guard.IsStringValid(link))
                    {
                        continue;
                    }

                    WebHandler.DownloadFile(link, nkhDir);
                }
            }
            Log.Output("NKHook5 successfully downloaded!");
        }
コード例 #2
0
        /// <summary>
        /// Download all files aquired from the GetDownloadURLs method
        /// </summary>
        private void DownloadUpdates()
        {
            List <string> downloads = GetDownloadURLs();

            foreach (string file in downloads)
            {
                WebHandler.DownloadFile(file, Environment.CurrentDirectory);
            }
        }
コード例 #3
0
        /// <summary>
        /// Get the text from the GitApiReleasesUrl
        /// </summary>
        /// <returns>The text on the page from the url</returns>
        private string GetGitApiText()
        {
            AquiredGitApiText = WebHandler.ReadText_FromURL(GitApiReleasesURL);
            if (!Guard.IsStringValid(AquiredGitApiText))
            {
                return(null);
            }

            return(AquiredGitApiText);
        }