Dim DirInfo As IO.DirectoryInfoDirInfo = New IO.DirectoryInfo("D:\test")For Each file In DirInfo.GetFiles("*.*", IO.SearchOption.TopDirectoryOnly)'設定抓檔案(*.jpg)限定在此資料夾下不包含子資料夾If ListBox1.Items.Contains(Microsoft.VisualBasic.Right(file.Name, Len(file.Name) - InStr(1, file.Name, "."))) = False ThenListBox1.Items.Add(Microsoft.VisualBasic.Right(file.Name, Len(file.Name) - InStr(1, file.Name, ".")))End IfNext file
全站熱搜
留言列表