Reading file

nibsy

Well-known member
Joined
Aug 7, 2002
Messages
51
Location
Kent, UK
How would you read the first file in a directory? (dont know the name of the file but know what directory it will be in).
 
The Directory.GetFiles method returns a string array of all files in a directory. Presumably, the first element in this array will be the "first" file in the directory.

When you have the path to the file, you can use File.Open to open it.
 
Back
Top