Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi all,

There is a timer control on my webform which is in asp.net

It checks every 1000 milliseconds for the time to be 9.15

At this time it does the required processes (i.e. GetData())

Do u know why sometimes the GetData() does not get triggered? even at 9.15?

 

Here is the code:

 

Private Sub tmr_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmr.Tick

StartTimer()

End Sub

 

Private Sub StartTimer()

Dim intDay As Integer

Dim intSysHour As Integer

Dim intSysMin As Integer

Dim intSetHour As Integer

Dim intSetMin As Integer

 

intSysHour = Now.Hour.ToString

intSysMin = Now.Minute.ToString

 

intSetHour = hsbHour.Value

intSetMin = hsbMin.Value

 

intDay = DateTime.Now.DayOfWeek

 

If Not (intDay = 6 Or intDay = 7) Then '6 and 7 represent saturday and sunday respectively...

If (intSysHour = intSetHour And intSysMin = intSetMin) Then

tmr.Enabled = False 'Once the process has started, turn off the timer...

GetData()

End If

End If

End Sub

Farshad

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...