Click here to Skip to main content
14,332,489 members
Rate this:
Please Sign up or sign in to vote.
See more:
i am developing a app in this there is a task performing according date match then timer must stopped but if date change of window system then timer must start again and check date if date back then nothing if date next then timer say task run

What I have tried:

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
f a = 0 Then
            If Today.Day = 19 Then
                a = 1
                System.Diagnostics.Process.Start(TextBox1.Text)
                 Else
                Timer1.Enabled = False

            End If
        End If end sub 
Posted
Updated 19-Dec-18 20:11pm
v2
Comments
OriginalGriff 18-Dec-18 12:36pm
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with. Typing as little as possible and showing a piece of seemingly irrelevant code doesn't help.

Use the "Improve question" widget to edit your question and provide better information.
Richard Deeming 18-Dec-18 12:46pm
   
You've tagged this as both "C" and "VB.NET".

That code doesn't look anything like C to me.
Rate this:
Please Sign up or sign in to vote.

Solution 2

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If a = 0 AndAlso Today.Day = 19 Then
            a = 1
            System.Diagnostics.Process.Start(TextBox1.Text)
        End If
    End Sub 
   
Rate this:
Please Sign up or sign in to vote.

Solution 1

If I am reading that correctly, if the day is the 19th then the a flag is set and the process is started. Otherwise, the timer is disabled. Something has to re-enable the timer for this to work again and that logic is not shown.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100