【问题标题】:How to upload the mobi file into dropbox using xamarin Android?如何使用 xamarin Android 将 mobi 文件上传到 Dropbox?
【发布时间】:2017-06-14 09:28:26
【问题描述】:

我们如何使用 xamarin Android 通过单击按钮将 .mobi 文件上传到 Dropbox?

【问题讨论】:

    标签: android xamarin dropbox


    【解决方案1】:

    你可以在你的项目中安装Xamarin.Dropbox.Api

    然后在这里查看文档:tutorial

    上传的代码是这样的:

    public 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);
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多