What I am trying to accomplsih:
- Get the CreationTime of two folders from a directory
- Store those times in an array
- Compare those two values in order to see which one has a larger value ( How do I compare variables of type date? )
Code:
Private Sub GetDirectoryInfo()
Dim array() As Date = Nothing
Dim counter As Integer = 0
Try
Dim myFolders As IEnumerable(Of DirectoryInfo) = Directory.GetDirectories("C:\SoundManager\Manage\Deploy\Manifest\Versions\", "*", _
SearchOption.TopDirectoryOnly).Select(Function(x) New DirectoryInfo(x))
For Each fName In myFolders
array(counter) = fName.CreationTime() //This line of code doesn't work when run
counter = counter + 1
Next
Catch ex As Exception
MsgBox("Error")
End Try