using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Diagnostics;
|
|
using System.Drawing;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace AutoUpdate
|
|
{
|
|
public partial class Update : Form
|
|
{
|
|
string[] updateInfo;
|
|
public Update(string[] args)
|
|
{
|
|
InitializeComponent();
|
|
updateInfo = args;
|
|
}
|
|
|
|
private void Update_Load(object sender, EventArgs e)
|
|
{
|
|
if (updateInfo != null && updateInfo.Length > 0)
|
|
{
|
|
var parameters = updateInfo[0].Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
|
|
var serverUrl = parameters[0];
|
|
var files = parameters[1].Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
|
foreach (var file in files)
|
|
{
|
|
var path = serverUrl + file;
|
|
var clientDownload = new WebClient();
|
|
clientDownload.DownloadFileAsync(new Uri(path), file);
|
|
}
|
|
}
|
|
Process.Start(Path.Combine(Application.StartupPath, "ButcherManageClient.exe"));
|
|
Application.Exit();
|
|
}
|
|
}
|
|
}
|