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

Storing directoy information

$
0
0
What I am trying to accomplsih:
  1. Get the CreationTime of two folders from a directory
  2. Store those times in an array
  3. 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


Viewing all articles
Browse latest Browse all 27355

Trending Articles