vijayshankark

hi all

i am trying to find a way to count the number of files in a particular folder.

i have done the same very easily in visual basic 6

but as i am creating a similar application in c# i am stuck up with this..

can anyone please help me with a code snippet or provide me some kind of assistance..

thank you.

it would be really greatful if someone helps me




Re: Visual C# Language count number of files in c#

Leon Tayson

This is easier in .NET...

System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo("c:\\");
int count = dir.GetFiles().Length;





Re: Visual C# Language count number of files in c#

vijayshankark

thank u Mr.Leon..

I will try this out and reply u.

thank u






Re: Visual C# Language count number of files in c#

vijayshankark

thank you Mr.Leon..

It worked

Thanks a lot






Re: Visual C# Language count number of files in c#

Leon Tayson

no problem... glad to help! ;-)