can someone help me get the file types to show up correctly? It should say the type such as text document, excel spreadsheet...etc. can someone tell me how i should change the fl.GetType.ToString to get it to show up right?
Here is what it looks like now
![]()
VB Code:
Dim fldr As DirectoryInfo Dim fl As FileInfo Dim count As Integer Dim tempFile Dim pos As Integer Try Directory.SetCurrentDirectory(txtPath.Text()) Catch e As Exception MsgBox(e.Message(), MsgBoxStyle.Critical, "") Exit Sub End Try listView1.Items.Clear() Dim currFldr As New DirectoryInfo(Directory.GetCurrentDirectory) If currFldr.FullName() <> currFldr.Root.ToString Then listView1.Items.Add("..", 1) count += 1 End If For Each fldr In currFldr.GetDirectories() If File.Exists(fldr.Name + "\folder.jpg") Then With listView1 .Items.Add(fldr.Name, 3) .Items(count).SubItems.Add("") .Items(count).SubItems.Add(fldr.GetType.Name()) .Items(count).SubItems.Add(fldr.LastWriteTime) End With Else With listView1 .Items.Add(fldr.Name, 2) .Items(count).SubItems.Add("") .Items(count).SubItems.Add(fldr.GetType.Name()) .Items(count).SubItems.Add(fldr.LastWriteTime) End With End If count += 1 Next For Each fl In currFldr.GetFiles() tempFile = fl.Name() pos = tempFile.LastIndexOf(".") If pos > 0 Then tempFile = tempFile.Substring(0, pos) End If If File.Exists(tempFile + ".tbn") Then With listView1 .Items.Add(fl.Name, 5) .Items(count).SubItems.Add(Format(Math.Ceiling(fl.Length / 1024), "###,###,###,###,###") & " KB") .Items(count).SubItems.Add(fl.GetType.ToString) .Items(count).SubItems.Add(fl.LastWriteTime) End With Else With listView1 .Items.Add(fl.Name, 4) .Items(count).SubItems.Add(Format(Math.Ceiling(fl.Length / 1024), "###,###,###,###,###") & " KB") .Items(count).SubItems.Add(fl.GetType.ToString) .Items(count).SubItems.Add(fl.LastWriteTime) End With End If count += 1 Next




Reply With Quote