Stream sr = Assembly.GetExecutingAssembly().GetManifestResourceStream("P2PC.ppc.pdf");
if (sr == null) return;
var reader = new BufferedStream(sr);
tempfile = Path.GetTempFileName() + ".pdf";
var data = new byte[reader.Length];
reader.Read(data, 0, (int) reader.Length);
File.WriteAllBytes(tempfile, data);
axAcroPDF1.Visible = true;
axAcroPDF1.LoadFile(tempfile);
to delete...
axAcroPDF1.Visible = false;
if (tempfile != null) File.Delete(tempfile);
if (sr == null) return;
var reader = new BufferedStream(sr);
tempfile = Path.GetTempFileName() + ".pdf";
var data = new byte[reader.Length];
reader.Read(data, 0, (int) reader.Length);
File.WriteAllBytes(tempfile, data);
axAcroPDF1.Visible = true;
axAcroPDF1.LoadFile(tempfile);
to delete...
axAcroPDF1.Visible = false;
if (tempfile != null) File.Delete(tempfile);
No comments :
Post a Comment