bored and playing around so i coded this shit
idea ?
it download string which contains the newest version and compare with the version at version.dat , if there is a new patch it download it and start it
ummm if there is more than 1 patch updated u need to add some do whiles (u can add them i wont wipe ur ass either)
code source
Code:
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.Net;
using System.IO;
namespace simple_updating
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
string path = Application.StartupPath;
string dotdatpath = path + "Version.dat";
if (File.Exists(dotdatpath) == false)
{
MessageBox.Show("could not locate the version.dat at " + dotdatpath);
Application.Exit();
}
{
StreamReader sr = new StreamReader("version.dat");
String line;
if ((line = sr.ReadLine()) != null)
label2.Text = line;
int currentversion = Convert.ToInt16(label1.Text);
if (currentversion == null)
{
MessageBox.Show("failed to read version.dat , please reinstall the client");
Application.Exit();
}
WebClient wc = new WebClient();
WebClient wc2 = new WebClient();
int newestversion = Convert.ToInt16(wc2.DownloadString("www.elitepvpers.com/sex/fuck/w/e/version.txt"));
if (newestversion == null)
{
MessageBox.Show("failed to recive the newest version , please try again later");
Application.Exit();
}
if (newestversion > currentversion)
{
wc.DownloadFileAsync(new Uri("www.elitepvpers.com/downloadpatchs/patch" + newestversion), Application.StartupPath);
System.Diagnostics.Process.Start(Convert.ToString(path + currentversion) + ".exe");
}
wc.DownloadProgressChanged += new DownloadProgressChangedEventHandler(wc_DownloadProgressChanged);
}
}
void wc_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
label4.Text = Convert.ToString( e.ProgressPercentage) + "%";
progressBar1.Maximum = 100;
progressBar1.Value = e.ProgressPercentage;
if (progressBar1.Value == 100)
this.Dispose();
}
}
}
i didnt test it yet -.- so move ur fucking ass and give it a try
a scan ? i dun give a fuck
what it actually depends on ? web client instance to download the string and the new patchs , lil dicky progressbar to check the progress also a lable throw event handler of web client instance
for ummm exit after patching ?
add this shit
if (progressBar1.Value == 100)
{
this.Dispose();
Application.Exit();
}
or ummm throw the event handler of download complet
aka
wc.DownloadFileCompleted += new AsyncCompletedEventHandler(wc_DownloadFileComplete d);
void wc_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
{
wipe his ass
}
ummm about download speed i unno how it will be but umm it's async anyway
design is the same shit as tq , ill add the ummm whole project
and umm i need to stop saying ummm but it's not ur own buss. -.- lol
yes im mad bro
P.s if anyone had developed a project about physcometric chart pm me , i've just done one but not with much graphics so was wondering if it worth it adding some xna shits o-0 lol , sorry but it's a project of mine at college so i give a shit about it
P.s for more safty scan it o-0 lol
P.s i like to say a7a
cya folks