Click here to Skip to main content
15,907,392 members
Please Sign up or sign in to vote.
3.67/5 (3 votes)
See more:
Dear All,

I have written my string arry like:
C#
string[] strImagePaths = new string[] { @"D:\HP\AA98020D[1].TIF", @"D:\HP\AA98020D[2.TIF" };

I have two image files in one folder. If I have n-No of files than how to pass?

Please suggest.

Thanks
Posted
Updated 20-Jan-11 20:07pm
v2

1 solution

see the below code

C#
DirectoryInfo dfo = new DirectoryInfo(@"D:\HP");
FileInfo[] fno = dfo.GetFiles();
foreach (FileInfo f in fno)
    MessageBox.Show(f.FullName);


instead of string array use FileInfo Array, which is useful ..
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900