.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
Post a Comment