我试图下载文件列表,但并不确定如何继续。 正如话题所述,我正在使用DropNet,并且这是我尝试下载文件的过程:使用DropNet从Dropbox下载文件
获取我应用程序专用文件夹中的所有文件的列表,并将它们作为字符串存储在列表中。
然后尝试以下操作:
foreach (string file in files)
{
_client.GetFileAsync("/" +file,
(response) =>
{
using(FileStream fs = new FileStream(path +file +".gttmp", FileMode.Create))
{
for(int i = 0; i < response.RawBytes.Length; i++)
{
fs.WriteByte(response.RawBytes[i]);
}
fs.Seek(0, SeekOrigin.Begin);
for(int i = 0; i < response.RawBytes.Length; i++)
{
if(response.RawBytes[i] != fs.ReadByte())
{
MessageBox.Show("Error writing data for " +file);
return;
}
}
}
},
(error) =>
{
MessageBox.Show("Could not download file " +file, "Error!");
});
}
不幸的是它似乎并没有在所有的工作。 任何人使用DropNet,可以建议我的东西,将工作?