• OOB 自动更新


    public App()
            {
                if (App.Current.InstallState == InstallState.Installed)
                   {
                       App.Current.CheckAndDownloadUpdateCompleted += OnCheckAndDownloadUpdateCompleted;
                       App.Current.CheckAndDownloadUpdateAsync();
                   }

                this.Startup += this.Application_Startup;
                this.Exit += this.Application_Exit;
                this.UnhandledException += this.Application_UnhandledException;

                InitializeComponent();

                new Login().Show();

            }

     /// <summary>
            /// 自动更新
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            private void OnCheckAndDownloadUpdateCompleted(object sender, CheckAndDownloadUpdateCompletedEventArgs e)
            {
                if (e.UpdateAvailable && e.Error == null)
                 {
                      MessageBox.Show("应用新版本已经下载成功,将在下次启动时生效。");
                 }
                 else if (e.Error != null)
                 {
                     MessageBox.Show("在检测应用更新时, 在"
                                    + "出现以下错误信息:"
                                    + Environment.NewLine
                                   + Environment.NewLine
                                   + e.Error.Message);
                  }
             }
      

  • 相关阅读:
    Space Ant(极角排序)
    Marriage Match II(二分+并查集+最大流,好题)
    Leapin' Lizards(经典建图,最大流)
    Food(最大流)
    99. Recover Binary Search Tree
    97. Interleaving String
    100. Same Tree
    98. Validate Binary Search Tree
    95. Unique Binary Search Trees II
    96. Unique Binary Search Trees
  • 原文地址:https://www.cnblogs.com/luxiaofeng54/p/1908747.html
Copyright © 2020-2023  润新知