예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string file = this.choosePath("Credenziali (*.json)|*.json");


            if (!string.IsNullOrEmpty(file))
            {
                this.lblJson.Text = System.IO.Path.GetFileName(file);
                GoogleDrive.login(file, true);
            }

            refreshTokenInput();
        }
예제 #2
0
        public static IList <Google.Apis.Drive.v3.Data.File> listFolderDrive()
        {
            GoogleDrive.login("C:\\token.json\\cred.json", false);

            IDictionary <string, string> res = new Dictionary <string, string>();

            FilesResource.ListRequest listRequest = GoogleDrive.service.Files.List();
            listRequest.Fields = "nextPageToken, files(id, name)";
            listRequest.Q      = "mimeType='application/vnd.google-apps.folder' and trashed=false";

            IList <Google.Apis.Drive.v3.Data.File> fldrs = listRequest.Execute()
                                                           .Files;

            return(fldrs);
        }