搜索
热搜: 活动 交友 discuz
查看: 1319|回复: 1
收起左侧

使用下面代码启动自动升级的,无法升级自己(.exe文件)

[复制链接]

该用户从未签到

发表于 2017-4-28 10:59:59 | 显示全部楼层 |阅读模式
try
                {
                    #region 检查更新

                    string sAutoUpdate = System.Configuration.ConfigurationManager.AppSettings["AutoUpdate"];

                    sAutoUpdate = sAutoUpdate.EndsWith("/") ? sAutoUpdate : sAutoUpdate + "/";

                    var updater = Updater.CreateUpdaterInstance(sAutoUpdate + "{0}", "update.xml");

                    //updater.Context.AutoKillProcesses = true;

                    //updater.UpdatesFound += updater_UpdatesFound;

                    updater.UpdateCancelled += updater_UpdateCancelled;

                    //updater.NoUpdatesFound += updater_NoUpdatesFound;
                    updater.EnsureNoUpdate();

                    #endregion
                }
                catch (Exception e)
                {
                    MessageBox.Show("自动更新发生了错误:" + e.Message);
                }
            }


您需要登录后才可以回帖 登录 | 入住

本版积分规则

申请友链| Archiver| 手机版| 鱼·后花园

GMT+8, 2024-4-27 13:17 , Processed in 0.018051 second(s), 17 queries , Redis On.

Powered by Discuz! X3.4

© 2005-2024 鱼·后花园

快速回复 返回顶部 返回列表