I would like to set my application to show system under maintenance if it hit the start time until the end time which i set in the xml (24 hrs). How do i code it. Please anyone can guide me.Thank You!


<Value Name="StartTime">22.45</Value>	
   <Value Name="EndTime">00.00</Value>

i have code like this....But it gives error...
Please guide me !!!!

Public Sub TimeCheck()
        If XmlStartTime between  XmlEndTime Then
            frmPopup1.YesNo = False
            frmPopup1.QorEx = False
        End If
    End Sub

anyone can help me!!!!!

Member Avatar


Mabye this will help you.

Public Class Form1

    Private StartTime As New TimeSpan(22, 27, 0)
    Private EndTime As New TimeSpan(23, 59, 59)
    Private WithEvents TimeCheck As New Timer With {.Interval = 60000}

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    End Sub

    Private Sub TimeCheck_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles TimeCheck.Tick
        Dim RightNow As TimeSpan = DateAndTime.Now.TimeOfDay

        If RightNow >= StartTime AndAlso RightNow <= EndTime Then
            'Right now is during a maintenance period.
            'Add Your code here Lock the UI and display the progress.
            MsgBox("I'm being updated")
            'Add your UI code here to unlock the UI.
        End If

    End Sub

End Class