Dropbox.GetFileList仅返回有限数量的文件

时间:2019-02-16 01:53:14

标签: c# dropbox-api

我有以下代码:

<recipe-step v-model="textArray[i]">

它返回有限数量的文件。

我没有计算它可以返回的最大文件数,但似乎在2,000-2,400之间。

这是GetFileList的代码:

public static void ReadAndInsertFromDropbox(string accessToken, string dropboxPath, string localPath)
{
    Dropbox db = new Dropbox(accessToken);
    List<string> allFiles = db.GetFileList(dropboxPath);
    allFiles.Sort();
    foreach (string allFile in allFiles)
    {
        string filePath = db.Download(dropboxPath, localPath, baseName);
    }
}

如何更改代码以允许下载无限数量的文件?

1 个答案:

答案 0 :(得分:1)

ListFolder接口是分页的,这意味着每个单个请求只能获得全部结果的一部分。除The ListFolderContinueAsync method外,还应使用ListFolderAsync,以获得所有结果。

您可以在the ListFolderAsync documentation中找到更多信息。