vb System.Deployment.Application.CheckForUpdateCompletedEventArgs.MinimumRequiredVersion类(方法)实例源码

下面列出了vb System.Deployment.Application.CheckForUpdateCompletedEventArgs.MinimumRequiredVersion 类(方法)源码代码实例,从而了解它的用法。

作者:VB.NET开发    项目:System.Deployment.Applicatio   
Dim WithEvents ADCheckForUpdateAsyncMin As ApplicationDeployment

Private Sub CheckForUpdateAsyncMin()
    If (ApplicationDeployment.IsNetworkDeployed) Then
        ADCheckForUpdateAsyncMin = ApplicationDeployment.CurrentDeployment

        ADCheckForUpdateAsyncMin.CheckForUpdate()
    End If
End Sub


Private Sub ADCheckForUpdateAsyncMin_CheckForUpdateCompleted(ByVal sender As Object, ByVal e As CheckForUpdateCompletedEventArgs) Handles ADCheckForUpdateAsyncMin.CheckForUpdateCompleted
    If Not (e.Error Is Nothing) Then
        MessageBox.Show("Could not install application update. Please try again later,  or contact a system administrator.", "Application Update Error")
        Return
    Else
        If (e.Cancelled) Then
            MessageBox.Show("The application update has been cancelled.", "Application Update Cancelled")
            Return
        End If
    End If

    ADCheckForUpdateAsyncMin = ApplicationDeployment.CurrentDeployment
    If (e.MinimumRequiredVersion > ADCheckForUpdateAsyncMin.CurrentVersion) Then
        ' Launch an install of the minimum required version. 
        ADCheckForUpdateAsyncMin.UpdateAsync()
    End If
End Sub


Private Sub ADCheckForUpdateAsyncMin_UpdateCompleted(ByVal sender As Object, ByVal e As AsyncCompletedEventArgs) Handles ADCheckForUpdateAsyncMin.UpdateCompleted
    ' Alert user that update is complete.
    If Not (e.Error Is Nothing) Then
        MessageBox.Show("Could not install application update. We will try and upgrade the application later.", "Application Update Error")
        Return
    Else
        If (e.Cancelled) Then
            MessageBox.Show("The application update has been cancelled.", "Application Update Cancelled")
            Return
        End If
    End If

    MessageBox.Show("The update was successful. Your application will now be restarted.", "Restart Application")
    Application.Restart()
End Sub


问题


面经


文章

微信
公众号

扫码关注公众号