Fetch the repository succeeded.
This action will force synchronization from General/GeneralUpdate, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
B站使用教程视频地址:
Gitee(码云)地址:
Nuget地址:
GitHub地址:
#region Launch1
args = new string[6] {
"0.0.0.0",
"1.1.1.1",
"https://github.com/WELL-E",
"http://192.168.50.225:7000/update.zip",
@"E:\PlatformPath",
"509f0ede227de4a662763a4abe3d8470",
};
GeneralUpdateBootstrap bootstrap = new GeneralUpdateBootstrap();//自动更新引导类
bootstrap.DownloadStatistics += OnDownloadStatistics;//下载进度通知事件
bootstrap.ProgressChanged += OnProgressChanged;//更新进度通知事件
bootstrap.Strategy<DefultStrategy>().//注册策略,可自定义更新流程
Option(UpdateOption.Format, "zip").//指定更新包的格式,目前只支持zip
Option(UpdateOption.MainApp, "your application name").//指定更新完成后需要启动的主程序名称不需要加.exe直接写名称即可
Option(UpdateOption.DownloadTimeOut,60).//下载超时时间(单位:秒),如果不指定则默认超时时间为30秒。
RemoteAddress(args).//这里的参数保留了之前的参数数组集合
Launch();//启动更新
#endregion
#region Launch2
/*
* Launch2
* 新增了第二种启动方式
* 流程:
* 1.指定更新地址,https://api.com/GeneralUpdate?version=1.0.0.1 在webapi中传入客户端当前版本号
* 2.如果需要更新api回返回给你所有的更新信息(详情内容参考 /Models/UpdateInfo.cs)
* 3.拿到更新信息之后则开始http请求更新包
* 4.下载
* 5.解压
* 6.更新本地文件
* 7.关闭更新程序
* 8.启动配置好主程序
* 更新程序必须跟主程序放在同级目录下
*/
//GeneralUpdateBootstrap bootstrap2 = new GeneralUpdateBootstrap();
//bootstrap2.DownloadStatistics += OnDownloadStatistics;
//bootstrap2.ProgressChanged += OnProgressChanged;
//bootstrap2.Strategy<DefultStrategy>().
// Option(UpdateOption.Format, "zip").
// Option(UpdateOption.MainApp, "").
// Option(UpdateOption.DownloadTimeOut,60).//下载超时时间(单位:秒),如果不指定则默认超时时间为30秒。
// RemoteAddress(@"https://api.com/GeneralUpdate?version=1.0.0.1").//指定更新地址
// Launch();
#endregion
private static void OnProgressChanged(object sender, ProgressChangedEventArgs e)
{
if (e.Type == ProgressType.Updatefile)
{
var str = $"当前更新第:{e.ProgressValue}个,更新文件总数:{e.TotalSize}";
Console.WriteLine(str);
}
if (e.Type == ProgressType.Done)
{
Console.WriteLine("更新完成");
}
}
private static void OnDownloadStatistics(object sender, DownloadStatisticsEventArgs e)
{
Console.WriteLine($"下载速度:{e.Speed},剩余时间:{e.Remaining.Minute}:{e.Remaining.Second}");
}
JusterZhu & WELL-E
WELL-E
juster.chu
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。