There are 2 points to be considered here.
The 1st is getting the information in the first place. One of the overloads
of System.IO.Directory.GetFiles allows searching sub-directories thus
allowing you to get all the filenames in a given tree in a single operation.
The 2nd point is that the result of a 'GetFiles' is an array of strings so
there is no need to put the results into another array or indeed write them
to a file individually. The System.String.Join method provides you with a
mechanism to write the entire array to a file in one operation.
In it's simplest terms it becomes:
File.WriteAllText([output filename], String.Join(Environment.Newline,
Directory.GetFiles([start point], "*.*", SearchOption.AllDirectories)))
"frogman7" <fr******@googlemail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
Sorry I didn't understand
I am using the system.IO.getfiles and getdirectories
I will look at your post and try it.
thanks