110,538
社区成员
发帖
与我相关
我的任务
分享
DirectoryInfo info = new DirectoryInfo(textBox1.Text);
foreach (FileInfo pdfFile in info.GetFiles("*.pdf"))
{
FileStream filestream = new FileStream(textBox1.Text + "\\" + pdfFile.Name, FileMode.Open);
byte[] pdfbyte = new byte[filestream.Length];
filestream.Read(pdfbyte, 0, (int)filestream.Length);
filestream.Close();
}
System.IO.FileStream fs = new System.IO.FileStream(filename, System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite, System.IO.FileShare.Read, 8192);
System.IO.BinaryWriter bw = new System.IO.BinaryWriter(fs);
bw.Write(filecontent, 0, filecontent.Length);
bw.Flush();
bw.Close();