Рет қаралды 20,322
Script 1:
using System.Net;
using System.Diagnostics;
InitializeComponent();
WebClient webClient = new WebClient();
try
{
if (!webClient.DownloadString("yourpastebinlink").Contains("1.5.0"))
{
if (MessageBox.Show("Looks like there is an update! Do you want to download it?", "Demo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
using (var client = new WebClient())
{
Process.Start("UpdaterDemo.exe");
this.Close();
}
}
}
catch
{
}
Script 2:
using System.Net;
using System.IO;
using System.Diagnostics;
using System.IO.Compression;
InitializeComponent();
WebClient webClient = new WebClient();
var client = new WebClient();
try
{
System.Threading.Thread.Sleep(5000);
File.Delete(@".\Demo.exe");
client.DownloadFile("yourfilelink", @"Demo.zip");
string zipPath = @".\Demo.zip";
string extractPath = @".\";
ZipFile.ExtractToDirectory(zipPath, extractPath);
File.Delete(@".\Demo.zip");
Process.Start(@".\Demo.exe");
this.Close();
}
catch
{
Process.Start("Demo.exe");
this.Close();
}
-----tags-----
auto updater, Visual studio auto updater, visual studio, auto updater c#, auto program updater