473,386 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

GetFiles in order


If I'm using something like....

Imports System.IO

Dim di As New DirectoryInfo(Path)
Dim fiArr As FileInfo() = di.GetFiles("*.doc")
Dim fi As FileInfo
For Each fi In fiArr
'do whatever
Next fi

....then is there a way to specify the order of the files read. I know that
I could do something like read the files into an array and then sort that,
but is there a default way of explicitly saying something like
di.GetFiles("*.doc",InDateOrder)

Thanks.
Nov 20 '05 #1
2 1586
* "Rob Oldfield" <rob@oldfield100_wow_freeserve_yikes_co_incredible !_uk> scripsit:
Dim di As New DirectoryInfo(Path)
Dim fiArr As FileInfo() = di.GetFiles("*.doc")
Dim fi As FileInfo
For Each fi In fiArr
'do whatever
Next fi

...then is there a way to specify the order of the files read.


No.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
I love those long answers. Thanks.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eM****************@TK2MSFTNGP12.phx.gbl...
* "Rob Oldfield" <rob@oldfield100_wow_freeserve_yikes_co_incredible !_uk>

scripsit:
Dim di As New DirectoryInfo(Path)
Dim fiArr As FileInfo() = di.GetFiles("*.doc")
Dim fi As FileInfo
For Each fi In fiArr
'do whatever
Next fi

...then is there a way to specify the order of the files read.


No.

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

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Demetri | last post by:
Using the GetFiles method of the DirectoryInfo instance one can pass in a search pattern of string type. For example: DirectoryInfo di = new DirectoryInfo("C:\temp"); FileInfo fi =...
3
by: S. Han | last post by:
I'm using Directory.GetFiles to enumerate files in a directory. The problem is if you have to enumerate all files + subdirectories recursively, it takes too much memory, and it fails. Is there...
4
by: Hrvoje Vrbanc | last post by:
Hello all! I have a small problem: I have an ASP.NET page that displays content of a folder in a DataGrid (more precisely, it displays Name, Lenth and CreationDate of the files). Default sort...
11
by: al jones | last post by:
I'm using filesystem.getfiles - and so far it's working correctly *however* I'd sure like to be able to pass it, as the last parameter, the extensions (plural) for which I'm looking. I assumed...
1
by: Hawk | last post by:
I was writing my own wildcard compare algorithm and making a custom GetFiles routine when I came across what I think is a bug in .net's own GetFiles. My routine was coming up with different...
13
by: Lance | last post by:
Hi All, I'm working on a program that requires searching multiple drives for multiple file types and cataloging them based on certain geospatial attributes. All together, there are hundreds of...
1
by: jobs | last post by:
Say I only have a single file I want to get information on. How can I adapt this code? Dim dr As DataRow Dim fi As FileInfo Dim dir As New DirectoryInfo(filename) Dim dt As New DataTable...
3
by: Michael Jackson | last post by:
In my .NET 2.0 VS 2005 VB application, I'm using Directory.GetFiles(path) to get all the files in the directory. However, I'm getting an error regarding "Illegal character in Path", even though I...
0
by: tshad | last post by:
I am trying to do multiple Directory.GetFiles and append the results to one array that I will process. I tried this: string strFiles; strFiles = Directory.GetFiles(SemaSettings.InputFilePath,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.