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..
it would be really greatful if someone helps meTuesday, February 13, 2007 3:58 AM
I was searching for the same on how to count the number of files in a particular folder on my machine. The piece of code did worked. Thanks a lot.
Could you please suggest on how do count a number of files in a particular folder on Remote Machine ?
I tried the below code(just updating few lines):
System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo("\\\\RemoteMachineName\\foldername");
int count = dir.GetFiles().Length;
But threw an exception as "The network path was not found"
Could you please help me on this.
Thank youWednesday, May 02, 2012 12:38 PM
I do not know if you are still working on "The network path was not found" exception. If you are, while specifying the drive on the remote machine you may want give it shot by using '$' in place of ':' . E.g. @"\\RemoteMachineName\C$\foldername" instead of @"\\RemoteMachineName\C:\foldername"Friday, August 03, 2012 7:32 PM