我的保管箱帐户上创建的文件只有80-90字节,而不是3-5 MB的完整大小。
上传功能:
async Task Upload(DropboxClient dbx, string folder, string file, string content)
{
using (var mem = new MemoryStream(Encoding.UTF8.GetBytes(content)))
{
var updated = await dbx.Files.UploadAsync(
folder + "/" + file,
WriteMode.Overwrite.Instance,
body: mem);
//Console.WriteLine("Saved {0}/{1} rev {2}", folder, file, updated.Rev);
}
}
我称之为功能:
var t = Task.Run(() => Upload(new DropboxClient("mykey"), "/TargetFolder", FileName, FileLocalLocation));
t.Wait();