In the loop reading the folder paths, you are concatenating the paths before passing them to loadMediaFolders(...)
. The first one will work since s
will be F:\stuff\Media\Movies\
, the second time s
will be F:\stuff\Media\Movies\D:\Media\Movies\
.
Try something like this
while (!paths.AtEndOfStream) {
content = paths.ReadLine();
loadMediaFolders(content);
}
loadMediaFolders(...)
already writes the result to stat.innerHtml
, so that line can be removed too. Keep in mind that you might be overwriting all of stat.innerHtml
, when you really wanted to concatenate the results, in loadMediaFolders(...)
.