【问题标题】:Upload files to Google Drive programmatically以编程方式将文件上传到 Google Drive
【发布时间】:2020-03-17 23:31:14
【问题描述】:

我的要求是将用户在运行时选择的单个文件上传到 Google 驱动器。我从用户那里获得电子邮件 ID 和密码。怎么做?如果我从用户那里得到任何其他要求?有什么可行的方案吗?

【问题讨论】:

    标签: vb.net google-drive-api


    【解决方案1】:

    您可以使用 Google Drive SDK/API,如果您通读文档,这是相当简单的东西,

    https://developers.google.com/drive/

    https://developers.google.com/drive/manage-uploads

    有一个 .NET API 可供下载,虽然它处于测试阶段,但我使用它没有问题。

    https://developers.google.com/drive/downloads

    【讨论】:

    • 谢谢,但我有一个疑问。我从我的用户那里获得电子邮件 ID 和密码。 google drive api 询问客户端 ID 和客户端密码。如何使用电子邮件 ID 和密码获取这些详细信息
    【解决方案2】:

    DocumentsService myService = new DocumentsService("应用程序名称"); myService.setUserCredentials("email", "password"); DocumentEntry newEntrys = myService.UploadDocument("pdf 路径", @"上传文件名");

    但我有例外 请求执行失败:https://docs.google.com/feeds/default/private/full?convert=false

    【讨论】:

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