我一直在到处寻找可以不断检查目录以查看是否有任何新文件的东西,如果有,它将将该文件名添加到列表中
我有这个,但只有当我点击列表时它才有效
Dim JAR As String = "*.jpg"
Dim DirInfo As DirectoryInfo = New DirectoryInfo(dir)
Dim Files() As FileInfo = DirInfo.GetFiles(JAR, SearchOption.AllDirectories)
Dim File As FileInfo
Const extension As String = ".jpg"
For Each File In Files
If (Not list.Items.Contains(File.Name)) Then
list.Items.Add(File.Name)
list.Text.Substring(0, ClientList.Text.Length - extension.Length)
list.Text = list.Items.Count
End If
Next (File)