StatCounter

View My Stats

Tuesday, February 10, 2009

Getting the group of files from directory with the name specific

Getting the group of files from directory with the name specific


DirectoryInfo di = new DirectoryInfo("c:\\accounts");
FileInfo[] fArr = di.GetFiles("??A??.txt");
for (int iCounter = 0 ; iCounter <>
iCounter++)
{
string str = fArr[iCounter].Name;
}


For the above Example i am loading the group of files from the directory of "C:\\\accounts" with the file third letter of "A"

di.GetFiles("A??.txt");
For the above Example i am loading the group of files from the directory of "C:\\\accounts" with the file Name starts with the letter "A"

No comments: