我怎么能编码这个Vb.Net

时间:2015-12-18 08:38:52

标签: vb.net

我有一个需要每30分钟执行一次的功能。如何使用Today.Minute过滤它? 这是我制作的代码。

mFlowLayout.setAdapter(new TagAdapter<String>(mVals)
   {
       @Override
       public View getView(FlowLayout parent, int position, String s)
       {
           TextView tv = (TextView) mInflater.inflate(R.layout.tv,
                   mFlowLayout, false);
           tv.setText(s);
           return tv;
       }
   });

请任何人。帮助:3

1 个答案:

答案 0 :(得分:0)

我想这样的事情可以解决问题:

Module StartupModule

    Private _timer As Timers.Timer

    Sub Main()
        SetTimer(3000)
        Console.ReadLine()
        KillTimer()
    End Sub

    Private Sub SetTimer(interval As Double)
        _timer = New Timers.Timer(interval)
        AddHandler _timer.Elapsed, AddressOf OnTimedEvent
        _timer.Start()
    End Sub

    Private Sub KillTimer()
        _timer.Stop()
        _timer.Dispose()
    End Sub

    Private Sub OnTimedEvent(source As Object, e As ElapsedEventArgs)
        Console.WriteLine(DateTime.Now)
    End Sub

End Module