How to authenticate users every time they send print commands

荒凉一梦 提交于 2019-12-11 18:24:50

问题


Need an idea to write a code to authenticate users before they send the commands to print.

Initial idea is to create a windows service which could bypass the call to the printer driver and can open a form for login credentials.

so that only the authenticated users who qualifies the monthly quota for printing the pages could access the printer.

Please share your views whether this approach is feasible and how this can be achieved.


回答1:


You can monitor the Win32_PrintJob WMI Class or the winspool.drv. You will find additional information here and here. Also, have a look at the FindFirstPrinterChangeNotification method.

Monitor the Win32_PrintJob WMI Class and pause the print job. Resume the job if the user has not reached the monthly quota. Otherwise, delete it.



来源:https://stackoverflow.com/questions/29486125/how-to-authenticate-users-every-time-they-send-print-commands

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!