Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# printing Printer
I have 3 printers, and, I whant to print a lot of files, so, I whant to know, how I can make a little and simple system to manage this printers, the base I know, but, I whant to know, How I can make the printer print and continue with verification to put more files to print in another printer... so, basicly what I mean is:
 
        private void printer()
        {
            int number = 0;
            GetPrintStatus gps = new GetPrintStatus();
            for (int i = 0; i < 5; i++)
            {
                if (number > 4)
                    number = 0;
                gps.SetPrinter = string.Format("HP - {0}", number);
                switch (gps.ToString())
                {
                    case "HP - 0":
                        if (gps.Status != status.Enable)
                            gps.print("1.pdf");
                        break;
 
                    case "HP - 1":
                        if (gps.Status != status.Enable)
                            gps.print("1.pdf");
                        break;
 
                    case "HP - 2":
                        if (gps.Status != status.Enable)
                            gps.print("1.pdf");
                        break;
 
                    case "HP - 3":
                        if (gps.Status != status.Enable)
                            gps.print("1.pdf");
                        break;
 
                    case "HP - 4":
                        if (gps.Status != status.Enable)
                            gps.print("1.pdf");
                        break;
                }
            }
 
OK, But, when the code go to: gps.print, to code stop there, and, continue when the printer return ok.... but, how I can do, to code continue ?
Posted 3-Jan-13 4:15am
Comments
Sergey Alexandrovich Kryukov at 3-Jan-13 16:08pm
   
I would strongly advise you to stop worrying about printing and start learning some programming. Right now, it all looks like you have no clue.
I cannot clearly understand from your description what you really want to do and especially why (and who will be helping you without knowing why?), but something tells me that wasting time on this problem won't be very useful. You real problem are way more more serious than that. Sorry if you disagree or frustrated, but...
—SA
Alexandre Bencz at 4-Jan-13 5:45am
   
It's the truth, I'm "surfing" for a world unknown to me...
Thank you for giving me this "touch" :)
Sergey Alexandrovich Kryukov at 4-Jan-13 7:21am
   
You are very welcome :-). You probably just need more regular approach. Slower, but with understanding every step you do. Go with simple console applications for a while, read some manual without skipping and come back to it as you try to write stuff. Focus on fundamentals; you can always learn specific details on different APIs, platforms and the like when you really need it, but the concepts you need right now. Most of the information is readily available on the Web.
 
Wish you the best of luck in New Year.
I'll try to help where I can...
—SA
Alexandre Bencz at 4-Jan-13 14:07pm
   
Thanks :)

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Please see my comment to the question.
 
I really think you have more serious problems. Calling ToString on the object which is already a string. Repeating totally identical code with almost identical data 5 times. (Never heard of abstractions? Method? Method parameters? Don't Repeat Yourself principle?) Your strange believe that you will always have 5 printers, not 2, not 6, as well as your readiness to write code specifically for 5 printers…
 
It makes no sense, but even if there was some sense… If I had some of your problems, I would forget about printing at all. Why wasting time?
 
—SA
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 310
1 CPallini 310
2 George Jonsson 269
3 Gihan Liyanage 255
4 OriginalGriff 245
0 OriginalGriff 4,903
1 CPallini 3,960
2 Sergey Alexandrovich Kryukov 3,474
3 George Jonsson 2,786
4 Gihan Liyanage 2,386


Advertise | Privacy | Mobile
Web03 | 2.8.140905.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100