c# check printer status

前端 未结 4 543
北海茫月
北海茫月 2020-12-25 15:31

in my application (Windows 7, VS2010) i have to decrement a credit counter after successfully printing an image. Anyway, before starting the entire process, i\'d like to kno

4条回答
  •  情深已故
    2020-12-25 15:46

    The only solution that is reliable across all brands of printers is to use SNMP to query the number of pages printed and ensure that it matches the number of pages in the document sent.

    SNMP OID for page count is 1.3.6.1.2.1.43.10.2.1.4

    From my testing, every other strategy has had unreliable behavior (odd null reference exceptions when fetching the print queue repeatedly) or provided inaccurate status codes or page counts.

提交回复
热议问题