Just finished writing this code to recursively go through the directory tree. This will be the basis for several other methods that I need to write to test my applications. Just thought I'd throw this out there for a code review to see what you folks think. Is there a better/more elegant way?

<font class="small">Code:</font><hr /><pre>
// Function to recursively go through directory tree.
function listDirectoryAndFiles(myDir)
// Get the current folder and set up our variables that we need.
var srcFolder = aqFileSystem.GetFolderInfo(myDir);
var folderFiles = srcFolder.Files;

// Go through all files in the folder.
while (folderFiles.HasNext()){
var FileItem = folderFiles.Next();
Log.Message("File name: " + FileItem.Name);

// Go through subfolder list and call this function again.
var subFolder = aqFileSystem.GetFolderInfo(myDir).SubFolders;
//If we don't have any more subfolders, we're done.
if (subFolder != null){
while (subFolder.HasNext()){
var FolderItem = subFolder.Next();
</pre><hr />

Ultimately, I'll be finishing the following methods:

CompareDirectoryContents - Compares the contents (not the files) of a directory. File names, directories, etc.

CompareDirectoryFiles - Compares all files in a single directory.

CompareDirectoryFilesRecursive - Compares all files in all directories, given the parent.