Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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:

C#
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
Comments
Sergey Alexandrovich Kryukov 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 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 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 4-Jan-13 14:07pm    
Thanks :)

1 solution

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
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900