Hi,

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!

XML

<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
            frmDialogSmall_Maintenance.Show()
            frmPopup1.YesNo = False
            frmPopup1.QorEx = False
            frmPopup1.ShowDialog()
        End If
    End Sub

anyone can help me!!!!!

Member Avatar for Unhnd_Exception

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
        TimeCheck.Start()
    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")
        Else
            'Normal 
            'Add your UI code here to unlock the UI.
        End If

    End Sub

End Class
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.