using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.IO; using iTextSharp.text.pdf; using iTextSharp.text.pdf.parser; using System.Windows.Forms; using pdf_app.Lib; namespace pdf_app { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { ArrayList files = new ArrayList(); string path = @"D:\Data Sets\Enron"; DirectoryInfo d = new DirectoryInfo(path); FileInfo[] pdffilenames = d.GetFiles("*.pdf"); foreach(FileInfo pdffilename in pdffilenames) { fileatt f = new fileatt(); f.fFullName = pdffilename.FullName; f.fName = pdffilename.Name; f.FileSize = pdffilename.Length; f.fExtension = pdffilename.Extension; byte[] bytes = File.ReadAllBytes(pdffilename.FullName); } MessageBox.Show("successfully"); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace pdf_app.Lib { class fileatt { public long FileSize { get; set; } public string fName { get; set; } public string fFullName { get; set; } public string fExtension { get; set; } public string fContent { get; set; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)