屠宰场客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.2 KiB

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();
}
}
}