Hi Guys
Im new to the forum, and VB.Net programming in general
can you please help me to convert the foreach loop highlighted in bold below to VB.Net (its currently C#)
Thanks ever so much![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Im new to the forum, and VB.Net programming in general
can you please help me to convert the foreach loop highlighted in bold below to VB.Net (its currently C#)
Thanks ever so much
VB.NET:
private int file_count = 0;
///
/// Get the file count of a given directory recursively.
///
public void GetDirectoryFileCount(string dir)
{
dir = dir + @”\”;
//get all the directories and files inside a directory
String[] all_files=Directory.GetFileSystemEntries(dir);
//loop through all items
[B]foreach(string file in all_files)[/B]
{
//check to see if the file is a directory if not increment the count
if(Directory.Exists(file))
{
//recursive call
GetDirectoryFileCount(file);
}
else
{
//increment file count
file_count++;
}
}
}