.net - C# cannot get printer status -


c# not getting status of printer. printing , want know status of printer whether "printer printing" or "printer out of paper".

here code :-

            string filepath = "c:\\users\\fouzan\\desktop\\abc.txt";             printdocument pd = new printdocument();             process p = new process();             processstartinfo startinfo = new processstartinfo();              startinfo.createnowindow = true;             startinfo.windowstyle = processwindowstyle.hidden;             startinfo.useshellexecute = true;             startinfo.filename = filepath;             startinfo.verb = "print";             startinfo.arguments = @"/p /h \" + filepath + "\"\"" +     pd.printersettings.printername + "\"";              p.startinfo = startinfo;             messagebox.show(p.startinfo.tostring());             p.start();             messagebox.show(p.start().tostring());               localprintserver server = new localprintserver();             printqueue printqueue = server.getprintqueue("samsung ml-2160 series");              //this outputs "none":-             messagebox.show(printqueue.queuestatus.tostring()); 

i getting "none" output how can know if printer printing or "out of paper".

i have selected default printer "samsung ml-2160 series" printer properties.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -