Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

DirectoryInfo Sorted

$
0
0
This works pretty good for my purposes but it would work better if the files ended up sorted by LastWriteTime. Of the few examples I've tried I can't seem to get the syntax correct.

Code:

        Dim di As New DirectoryInfo("h:\in\")
        Dim fiArr As FileInfo() = di.GetFiles()
        Dim fri As FileInfo
        For Each fri In fiArr
            Dim TextArray As String() = File.ReadAllLines("H:\in\" & fri.Name)
            TextBox1.Text = TextBox1.Text & fri.LastWriteTime & "  " & Chr(9) & Mid(fri.Name, 1, Len(fri.Name) - 4) & Chr(9) & _
                TextArray(5) & Chr(9) & TextArray(1) & " x " & TextArray(2) & vbCrLf
        Next fri


Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>