sort array of filenames by create-date

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jurgen Oerlemans

    sort array of filenames by create-date

    Hello,

    I created an array of files in a directory by doing a:

    Dim FileArray As String() = IO.Directory.Ge tFiles(QueueSou rce, "*.Q")

    My question is: How can I sort this array on the create-date of the files?

    Best regards, Jurgen Oerlemans


  • Herfried K. Wagner [MVP]

    #2
    Re: sort array of filenames by create-date

    * "Jurgen Oerlemans" <jurgen.oerlema ns@envirolab.no _spam.nl> scripsit:[color=blue]
    > I created an array of files in a directory by doing a:
    >
    > Dim FileArray As String() = IO.Directory.Ge tFiles(QueueSou rce, "*.Q")
    >
    > My question is: How can I sort this array on the create-date of the files?
    >
    > Best regards, Jurgen Oerlemans[/color]

    Get an array of 'FileInfo' objects and then sort them by create-date.
    Maybe you'll have to write your own 'Comparer'.

    --
    Herfried K. Wagner [MVP]
    <URL:http://dotnet.mvps.org/>

    Comment

    • Cor Ligthert

      #3
      Re: sort array of filenames by create-date

      Hi Jurgen,

      I did not test it, however this looks me a very nice sample from Tom
      Shelton,



      I hope (assume) it helps?

      Cor




      Comment

      • Cor Ligthert

        #4
        Re: sort array of filenames by create-date

        Echo off


        Comment

        • Cor Ligthert

          #5
          Re: sort array of filenames by create-date

          Sorry,

          I see now you sand at the same time, so I take this one back.
          :-)
          Cor


          Comment

          • One Handed Man \( OHM - Terry Burns \)

            #6
            Re: sort array of filenames by create-date

            LOL

            --

            OHM ( Terry Burns )
            . . . One-Handed-Man . . .

            Time flies when you don't know what you're doing

            "Cor Ligthert" <notfirstname@p lanet.nl> wrote in message
            news:edUHIvMZEH A.1448@TK2MSFTN GP12.phx.gbl...[color=blue]
            > Echo off
            >
            >[/color]


            Comment

            Working...