I have this method :
private static string browse(Microsoft.SharePoint.Client.Folder folder,
ClientContext ctx,ref StringBuilder str)
{
string folderName;
str.AppendLine("browse" + folder.Name);
ctx.Load(folder.Folders);
ctx.ExecuteQuery();
if (folder.Folders.Count > 0)
{
for (var i = 0;i<folder.Folders.Count ; i++)
{
browse(folder.Folders[i], ctx, ref str);
folderName = folder.Folders[i].Name;
}
}
return folderName;
}
When I call it, the folderName that it returns is an empty string and I don't understand why.