private void btnSearchFolder_Click(object sender, EventArgs e) { string selectedPath = DialogHelper.BrowseForFolderDialog(); if (!string.IsNullOrEmpty(selectedPath)) { List <X509Certificate2> certs = Utilities.SearchForCertsInFolder(selectedPath); CertificateRowCollection certRowCollection = CertificateRowCollection.FromList(certs); List <string> publicKeys = certRowCollection.GetAllCertificatesPublicKeyValues(); string filename = Utilities.EnsureFilenameNotExists(Utilities.PublicKeysFolderOutputFilename); File.WriteAllLines(filename, publicKeys); } }
private void btnSearchFolder_Click(object sender, EventArgs e) { using (FolderBrowserDialog dlg = new FolderBrowserDialog()) { if (dlg.ShowDialog() == DialogResult.OK) { List <X509Certificate2> certs = Utilities.SearchForCertsInFolder(dlg.SelectedPath); CertificateRowCollection certRowCollection = CertificateRowCollection.FromList(certs); List <string> publicKeys = certRowCollection.GetAllCertificatesPublicKeys(); string filename = Utilities.EnsureFilenameNotExists(Utilities.PublicKeysFolderOutputFilename); File.WriteAllLines(filename, publicKeys); } } }
private void PopulateCells() { certificateRowCollection = new CertificateRowCollection(); SetDataSource(certificateRowCollection); }