Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////Paste this in anywhere in ur code//////
- public static String GetHtmlStringWC(string url)
- {
- string htmlString = string.Empty;
- try
- {
- using (WebClient webClient = new WebClient())
- {
- try
- {
- webClient.Headers["User-Agent"] = "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15";
- WebProxy myProxy = new WebProxy();
- myProxy.IsBypassed(new Uri(url));
- webClient.Proxy = myProxy;
- htmlString = webClient.DownloadString(url);
- }
- catch (Exception ex)
- {
- throw;
- }
- finally
- {
- webClient.Dispose();
- }
- }
- }
- catch (WebException wex)
- {
- throw;
- }
- catch (Exception ex)
- {
- throw;
- }
- finally { }
- return htmlString.Replace("\r", string.Empty).Replace("\n", string.Empty).Replace("\t", string.Empty);
- }
- //////Then paste this in the form load event (change the pastebin link to ur link)////////
- int version = 1;
- string contents = GetHtmlStringWC("https://pastebin.com/raw/9ExFnXLf");
- Console.WriteLine(contents);
- {
- if (version.ToString() != contents)
- {
- DialogResult result = MessageBox.Show("There is an update found, would you like to update?", "Updates", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
- if (result == DialogResult.Yes)
- {
- Process.Start("https://github.com/nuncahacks/Youtube-Downloader/raw/master/Yotube%20Downloader.exe");
- }
- if (result == DialogResult.No)
- {
- Application.Exit();
- }
- else
- {
- MessageBox.Show("No updates found", "Updates", MessageBoxButtons.OK);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement