I am developing a windowform application in C #.
In my application, I wrote the code below to get all the images from the local computer and print it.
files = Directory.GetFiles(@"C:\temp", "*.jpeg"); foreach (var i in files) { var objPrintDoc = new PrintDocument(); objPrintDoc.PrintPage += (obj, eve) => { System.Drawing.Image img = System.Drawing.Image.FromFile(i); Point loc = new Point(100, 100); eve.Graphics.DrawImage(img, loc); }; objPrintDoc.Print(); }
Now I want to check whether this printing was successful or not, and then I want to delete the temporary folder that I created manually for storing images.
I tried the code below, but that didn't work for me.
PrintServer myPrintServer; PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues(); String printQueueNames = "My Print Queues:\n\n"; foreach (PrintQueue pq in myPrintQueues) { printQueueNames += "\t" + pq.Name + "\n"; }
Please inform us of my problem and follow the necessary steps.
Thanks Prashant
User5590
source share