是否可以获取Google云端硬盘文件的所有者? [英] Is it possible to get the owner for a Google Drive file?
问题描述
当我在线查看Google云端硬盘时,我看到文件中列出了所有者,有时我本人或其他人也将其显示为共享者".是否可以通过编程方式(使用C#)获取此值?
When I look at my Google Drive online, I see files have the owner listed, sometimes shown as "Shared By" myself or someone else. Is it possible to obtain this value programmatic-ally (using C#)?
理想情况下,我想让某人与我共享文件,然后(通过Windows服务)对文件进行一些处理,然后使用更改将其重新上传到文件中.我需要知道文件的所有者.
Ideally I want to have someone share a file with me, then me do some processing on the file (via a Windows Service), and then me re-upload the file with it's alterations. I would need to know the owner of the file though.
这可能吗?不使用Google云端硬盘API就能做到吗?-我正在考虑使用正常的.NET/Windows功能将文件从Google云端硬盘本地文件夹中提取...
Is this possible? Is this possible without using the Google Drive API? - I'm thinking about using normal .NET/Windows functions to pull the file out of the Google Drive local folder...
推荐答案
Google云端硬盘API返回的文件资源包括 userPermission
字段,该字段列出了有权访问文档的用户及其角色(所有者),读者或作家):
File resources returned by the Google Drive API include a userPermission
field which lists users authorized to access the document together with their role (owner, reader or writer):
https://developers.google.com/drive/v1/reference/files#resource
这篇关于是否可以获取Google云端硬盘文件的所有者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!