vb.net 以编程方式将文件上传到 Google Drive

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16608254/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 13:37:13  来源:igfitidea点击:

Upload files to Google Drive programmatically

vb.netgoogle-drive-api

提问by Sathish

My requirement is to upload a single file which will be selected by the user during runtime to Google drive. I am getting email id and password from user. How to do it? If i any other requirement get from users? any feasible solution is there?

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

回答by GJKH

You can use the Google Drive SDK/API, it's fairly simple stuff if you read through the documentation,

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

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

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

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

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

There's a .NET API available for download, although it's in beta I've used it without problem.

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

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

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

回答by Ersel Bozkartal

DocumentsService myService = new DocumentsService("application name"); myService.setUserCredentials("email", "password"); DocumentEntry newEntrys = myService.UploadDocument("pdf path", @"upload file name");

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

But I have take exception Execution of request failed: https://docs.google.com/feeds/default/private/full?convert=false

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