G
Guest
I have partial code that works (below) that returns the folders in the
directory to a listbox but it is not sorted by LastCreateDate or
LastWriteDate. I only need to return 1 record (the most recently created
folder to a textbox)
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Try
ListBox1.Items.Clear()
Dim path As String = "S:\Movies\ABC\FMRSST"
For Each f As String In System.IO.Directory.GetDirectories(path)
Dim filename As String = f.Substring(f.LastIndexOf("\") + 1)
Dim sLastWritedate As String =
System.IO.File.GetLastWriteTime(path)
'Dim fn_withoutextn As String = filename.Substring(0,
filename.IndexOf("."))
ListBox1.Items.Add(filename)
Next
Catch ex As System.Exception
End Try
End Sub
thanks in advance
directory to a listbox but it is not sorted by LastCreateDate or
LastWriteDate. I only need to return 1 record (the most recently created
folder to a textbox)
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Try
ListBox1.Items.Clear()
Dim path As String = "S:\Movies\ABC\FMRSST"
For Each f As String In System.IO.Directory.GetDirectories(path)
Dim filename As String = f.Substring(f.LastIndexOf("\") + 1)
Dim sLastWritedate As String =
System.IO.File.GetLastWriteTime(path)
'Dim fn_withoutextn As String = filename.Substring(0,
filename.IndexOf("."))
ListBox1.Items.Add(filename)
Next
Catch ex As System.Exception
End Try
End Sub
thanks in advance