I'm using the following code to get all of the files from a DVD drive and load them into a bindinglist and then a datagridview:
This shows all files and folder names on the disc. If I want it to show all files, regardless of the folder they're in, is there a built-in method to do that or do I need to take an entry, identify it as a directory and then use that as my source to read the files in it? thanksCode:mAddBL.Clear() ' Try Dim dir As New IO.DirectoryInfo(Form1.m_DVDdrive & ":\") Dim filesarray As IO.FileInfo() = dir.GetFiles() Dim file As IO.FileInfo Dim filename As String Dim extpos As Integer ' For Each file In filesarray ' extpos = InStr(file.Name, ".") If extpos > 0 Then filename = Microsoft.VisualBasic.Left(file.Name, extpos - 1) End If ' mAddBL.Add(New qckMovies(filename, "DVD", "Movie", True)) ' Next ' SetdgvAdd() ' Catch ex As Exception MessageBox.Show(ex.Message, "No DVD or CD in Drive") Me.Close() End Try




Reply With Quote