using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System****;
using System.Net;
using System.Security.Cryptography;
namespace Updater
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
try
{
timer1.Start();
//======================================
HttpWebRequest Requestzz = (HttpWebRequest)WebRequest.Create("https://dl.dropbo*****m/u/78998523/name.txt"); //Creates a httpwebrequest to post to the login.php
HttpWebResponse Responsezz = (HttpWebResponse)Requestzz.GetResponse(); //After writing data to the stream get the response
StreamReader resReaderzz = new StreamReader(Responsezz.GetResponseStream()); //Convert to response to string
String strzz = resReaderzz.ReadLine();
//======================================
//=======================================
StreamReader sr = new StreamReader("version.txt");
HttpWebRequest Request = (HttpWebRequest)WebRequest.Create("https://dl.dropbo*****m/u/78998523/latestversion.txt"); //Creates a httpwebrequest to post to the login.php
HttpWebResponse Response = (HttpWebResponse)Request.GetResponse(); //After writing data to the stream get the response
StreamReader resReader = new StreamReader(Response.GetResponseStream()); //Convert to response to string
String str = resReader.ReadLine(); //Read contents of the whole string (Which is the same if you view source of php script
//=========================================
//=========================================
HttpWebRequest Requestz = (HttpWebRequest)WebRequest.Create("https://dl.dropbo*****m/u/78998523/url.txt"); //Creates a httpwebrequest to post to the login.php
HttpWebResponse Responsez = (HttpWebResponse)Requestz.GetResponse(); //After writing data to the stream get the response
StreamReader resReaderz = new StreamReader(Responsez.GetResponseStream()); //Convert to response to string
String strz = resReaderz.ReadLine();
//=======================================
String latest = str;
int latestz = int.Parse(latest); //latest version
int latestversion = latestz;
string number = sr.ReadLine();
int currentversion = int.Parse(number); //current version
//======================================
if (currentversion < latestversion) // if current version is < (down) than latest version
{
sr.Close();
resReader.Close();
WebClient wc = new WebClient();
wc.DownloadFileAsync(new Uri(strz), strzz); //download the file
//strz = URL
//strzz = File Name
wc.DownloadProgressChanged += (s, x) => progressBar1.Value = x.ProgressPercentage; // show progress in progressbar in percentage
wc.DownloadProgressChanged += (s, x) => label1.Text = "%" + x.ProgressPercentage.ToString(); //show progress in percentage in label1
StreamWriter sw = new StreamWriter("version.txt");
sw.WriteLine(latestversion); //write latest version to version.txt
sw.Close(); //close streamReader
}
else
{
MessageBox.Show("No Updates are Currently available"); //show the message that you already have the latest version
this.Close(); //close form
}
}
catch (Exception ex) //If there is an error, display what was wrong with a message box
{
MessageBox.Show(ex.Message, "Error : Updater");
this.Close();
}
}
private void timer1_Tick(object sender, EventArgs e)
{
if (label1.Text == "%100")
{
this.Close();
}
}
}
}

WebClient Cli = new WebClient();
if(CLi.DownloadString(PasteBin Link) != Properties.Settings.Default.VersionNum)
{
MessageBox.Show("New Update, downloading now...");
Cli.DownloadFile(My File);
//* Make File *
MessageBox.Show("File downloaded :D");
Process.Start(New File);
Application.Exit();
}
else MessageBox.Show("No new updates :D");


public void myshit()
{
try
{
reader = new XmlTextReader(xmlUrl);
reader.MoveToContent();
string elementName = "";
if ((reader.NodeType == XmlNodeType.Element) && (reader.Name == "DevConnect"))
{
while (reader.Read())
{
if (reader.NodeType == XmlNodeType.Element)
{
elementName = reader.Name;
}
else
{
if ((reader.NodeType == XmlNodeType.Text) && (reader.HasValue))
{
switch (elementName)
{
case "Version":
newVersion = new Version(reader.Value);
break;
}
}
}
}
}
}
catch (Exception)
{
MessageBox.Show("Problems Found", "AHDEVConnect",
MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk);
}
finally
{
if (reader != null)
reader.Close();
}
private void button1_Click_1(object sender, EventArgs e)
{
System.Diagnostics.Process.Start(downloadURL);
this.Close();
}