谷歌驱动器 - 如何从代码(编程)清空回收站吗? [英] Google Drive - How to empty trash from code (programmatically)?

查看:979
本文介绍了谷歌驱动器 - 如何从代码(编程)清空回收站吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮我与谷歌云端硬盘中的项目集成。
的问题是,谷歌云端硬盘回收站文件夹中是从来没有空,所以最终与桌面谷歌驱动同步停止工作,由于空间不足。

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) .

如何从代码或脚本或任何清空谷歌云端硬盘回收站?

How do I empty Google Drive trash from code or script or whatever?

推荐答案

该谷歌云端硬盘API不公开清空回收站的方法,但它有一个删除方法要永久删除文件,而送他们到垃圾桶:

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/files/delete

您也可以通过检查丢弃标签检索垃圾文件文件资源,然后调用删除在他们身上。

You can also retrieve files from trash by checking the trashed label of the Files resource and then call delete on them.

这篇关于谷歌驱动器 - 如何从代码(编程)清空回收站吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆