计时器不会停止作为日期匹配 [英] Timer not stop as date match

查看:128
本文介绍了计时器不会停止作为日期匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,有一个任务执行按日期匹配,然后计时器必须停止但如果日期更改窗口系统然后计时器必须再次启动并检查日期,如果日期回来然后没有,如果日期接下来,然后计时器说任务运行



我的尝试:



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 

推荐答案

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 


如果我正确读取,如果那天是19然后设置一个标志并开始该过程。否则,计时器被禁用。有些东西必须重新启用计时器才能再次工作,并且不显示逻辑。
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.


这篇关于计时器不会停止作为日期匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆