static void Main(string[] args) { var files = Extractor.GetFilesPaths(@"C:\materials", new[] { "*.pdf" }); try { ExcelImporter.Export("test.xlsx", files); Console.WriteLine("ok"); } catch (Exception e) { Console.WriteLine(e); } Console.ReadLine(); }
private void button1_Click(object sender, EventArgs e) { if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) { try { IEnumerable <string> filesPaths = Extractor.GetFilesPaths(folderBrowserDialog1.SelectedPath, new[] { "*.mp3", "*.jpg" }); ExcelImporter.Export("content.xlsx", filesPaths); } catch { MessageBox.Show("Ошибка в ядре", "Упс", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Что то пошло не так", "Упс", MessageBoxButtons.OK, MessageBoxIcon.Error); } }