Exemplo n.º 1
0
        private IList <ParentReference> GetParents(String id)
        {
            //"0Bw796eEWuOTyYzk0czhvTHU0U2c"
            List <ParentReference> result = new List <ParentReference>();

            ParentsResource.ListRequest request = service.Parents.List(id);
            try
            {
                ParentList parents = request.Execute();
                return(parents.Items);
            }
            catch (Exception e)
            {
                Console.WriteLine("An error occurred: " + e.Message);
            }
            return(null);
        }
Exemplo n.º 2
0
        public static void PrintParents(DriveService service, String fileId)
        {
            ParentsResource.ListRequest request = service.Parents.List(fileId);

            try
            {
                ParentList parents = request.Execute();

                foreach (ParentReference parent in parents.Items)
                {
                    Console.WriteLine("File Id: " + parent.Id);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("An error occurred: " + e.Message);
            }
        }