我需要帮助过滤特定时间/日期(所有文件都是.jpeg格式)在我的程序报告生成(运动检测系统)中,用户可以在其中查看从特定时间点到另一个时间点的检测到的图像(例如,下午1:00 - 下午2:00)然后在列表框中显示文件.
示例截图文件名:pic_HHMMss_ddMMMyyyy
系统的工作原理如下.在网络摄像头检测到动作后,它会自动捕获图像并将其保存到C:\ Surveillance System\Detected并生成文件名pic_HHMMss_ddMMMyyyy.因此,现在这是报告生成表格,其中授权人员可以通过过滤捕获照片时的时间/日期来查看检测到的图像.
现在,我只能在没有任何过滤器的情况下显示目录中的所有文件.非常感谢任何见解或帮助.谢谢!:)代码:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' make a reference to a directory
Dim di As New IO.DirectoryInfo("c:\Surveillance System\Detected")
Dim diar1 As IO.FileInfo() = di.GetFiles()
Dim dra As IO.FileInfo
'list the names of all files in the specified directory
For Each dra In diar1
ListBox1.Items.Add(dra)
Next
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
PictureBox1.Image = Image.FromFile("C:\Surveillance System\Detected\" & …
Run Code Online (Sandbox Code Playgroud)