private void Form2_Load(object sender, EventArgs e) { listView1.View = View.Details; listView1.Columns.Add("Filename", 150, HorizontalAlignment.Left); listView1.Columns.Add("FileId", 150, HorizontalAlignment.Left); listView1.Columns.Add("Size (bytes)", 150, HorizontalAlignment.Left); credential = GoogleDriveProvider.GetCredentials(Scopes); GoogleDriveProvider.GetItemsFromGoogleDrive(credential, ApplicationName, listView1); SetStyle(ControlStyles.SupportsTransparentBackColor, true); }
private void ChangeAccount_Click(object sender, EventArgs e) { var credPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); credPath = Path.Combine(credPath, ".credentials/drive-dotnet-quickstart.json"); var dir = new DirectoryInfo(credPath); dir.Attributes = dir.Attributes & ~FileAttributes.ReadOnly; dir.Delete(true); credential = GoogleDriveProvider.GetCredentials(Scopes); listView1.Items.Clear(); GoogleDriveProvider.GetItemsFromGoogleDrive(credential, ApplicationName, listView1); }
private void Refresh_Click(object sender, EventArgs e) { listView1.Items.Clear(); GoogleDriveProvider.GetItemsFromGoogleDrive(credential, ApplicationName, listView1); }