First file within a directory

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi...I have a requirement to find the first file within a directory. I know
we can use the GetFiles() method of Directory class, but am a little stuck up
with the syntax.

Can somebody plz let me know who this can be done?

Thanks...
 
Gaurav said:
Hi...I have a requirement to find the first file within a directory. I know
we can use the GetFiles() method of Directory class, but am a little stuck up
with the syntax.

Can somebody plz let me know who this can be done?

You asked the same question a couple of hours ago and
got two replies.

Why not start from there instead of starting a new thread.

Arne
 
Arne Vajhøj said:
You asked the same question a couple of hours ago and
got two replies.

Why not start from there instead of starting a new thread.

Do you want me to step on the OP for you? I can certainly do that. It would
be a pleasure. :)
 
What is meant by "the first file within a directory"? First in what sense?
The one that happens to be the first entry stored in the directory? Why is
that useful? Or do you mean the first after the files are sorted by some
criterion, such as name or age?
 
What is meant by "the first file within a directory"? First in what sense?
The one that happens to be the first entry stored in the directory? Why is
that useful? Or do you mean the first after the files are sorted by some
criterion, such as name or age?

Does the 'First' file mean the first file you can see in windows
explorer. As per default setting files are sorted based on FileName.
Clarify what exactly you want to achieve. If it's filename sort order
you can use Array.Sort method as pointed out by Arnold.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top