我有两列结构列表(timerMillisec& myfilename)。 我需要能够为每一行运行一个单独的计时器,它将根据行的时间打开指定的文件名。
timerMillisec以毫秒为单位。
以下是我的结构清单和完美的工作。
我试图编写一个能够读取结构列表并分别运行每个新计时器的函数,但我无法做到。
Structure StructCheckTimer
Public timerMillisec As Long
Public myfileName As String
Public Sub New(ByVal verTime As Long, ByVal verFilename As String)
Me.timerMillisec = verTime
Me.myfileName = verFilename
End Sub
End Structure
Public newStructCheckTimer As New List(Of StructCheckTimer)
newStructCheckTimer.Add(New StructCheckTimer("15000", "c:\myfile1.txt"))
newStructCheckTimer.Add(New StructCheckTimer("5000", "c:\myfile2.txt"))
newStructCheckTimer.Add(New StructCheckTimer("20000", "c:\myfile3.txt"))
...
我用下面的
读了我的结构清单Dim friendsCollection As ICollection = newStructCheckTimer
For Each s As StructCheckTimer In friendsCollection
MsgBox(s.timerMillisec & " -- " & s.myfileName)
Next