问题描述
请帮助我将一个项目与 Google Drive 集成.问题是 Google Drive 的垃圾文件夹永远不会清空,因此最终由于空间不足,Google Drive 与桌面的同步停止工作.
Please help me to integrate a project with Google Drive. The problem is that Google Drive trash folder is never emptied, so eventually Google Drive synchronization with desktop stops working due to the lack of space.
我需要将垃圾箱配置为不保留已删除的文件(首选选项),或者以编程方式从 C# 代码(不太首选)或其他编程语言(最后的选项)中清空它.
I need either to configure the trash to not keep deleted files (preferred option) or empty it programatically from C# code (less preferred), or other programing language (last resort option) .
如何从代码或脚本或其他内容中清空 Google 云端硬盘回收站?
How do I empty Google Drive trash from code or script or whatever?
推荐答案
Google Drive API 没有公开清空垃圾箱的方法,但它有一个 delete 方法来永久删除文件,无需将它们送入垃圾箱:
The Google Drive API doesn't expose a method to empty the trash but it has a delete method to delete files permanently, without sending them into the trash:
https://developers.google.com/drive/v2/reference/文件/删除
您还可以通过检查 trashed 标签从垃圾箱中检索文件noreferrer">文件资源,然后对它们调用delete.
You can also retrieve files from trash by checking the trashed label of the Files resource and then call delete on them.
这篇关于Google Drive - 如何从代码中清空垃圾(以编程方式)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)