public void CheckUpdate(bool beta = false)
{
checkBeta = beta;
DirectoryInfo theFolder = new DirectoryInfo(Environment.CurrentDirectory);
FileInfo[] fileInfo = theFolder.GetFiles();
foreach (FileInfo file in fileInfo)
{
if (file.Name.Contains(".delete"))
{
File.Delete(file.FullName);
Log.Debug($"已删除更新残留文件{file.FullName}");
MessageBox.Show("更新完成o(^▽^)o", "蛤蛤蛤蛤蛤", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
try
{
Log.Info("正在检查更新");
WebClient http = CreateWebClient();
http.DownloadStringCompleted += Http_DownloadStringCompleted;
http.DownloadStringAsync(new Uri(UpdateURL));
}
catch
{
Log.Error("检查更新失败 - 版本检查失败");
}
}