PrintQueue中的事件 [英] Events in PrintQueue

查看:73
本文介绍了PrintQueue中的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ps = new PrintServer(printserverName);

PrintQueue pq1 = new PrintQueue(ps, pq.Name); 

据我了解, pq1 是一个打印机队列,将处理打印作业.

As per my understanding, pq1 is a printer Queue which will handle print jobs.

我想捕获此打印队列的事件.

I want to catch events for this print queue.

例如,如果用户A提供打印,则此打印作业将添加到队列中.我想捕获此添加到队列事件中的作业,因此,我可以知道允许用户使用多少页面或验证用户

For example, if user A gives a print then this print job is added into the queue.I want to catch this job added into the queue event.So, I can know how many pages are allowed to user or validating the user.

推荐答案

就像在win32 API级别上一样,您可以选择挂接事件队列:

Looks like at the win32 API level you have an option to hook up to queue events:

除非您一直在轮询队列的作业集合,否则我在.NET中找不到相同的内容.

I Could not find the same in .NET unless you keep polling for the job collection for the queue.

看看:

http://msdn.microsoft.com/en-us/library/dd162722(v=vs.85).aspx

PRINTER_CHANGE_JOB

PRINTER_CHANGE_JOB

通知对作业的任何更改.您可以设置此常规标志,也可以设置以下一个或多个特定标志:

Notify of any changes to a job. You can set this general flag or one or more of the following specific flags:

PRINTER_CHANGE_ADD_JOBPRINTER_CHANGE_SET_JOBPRINTER_CHANGE_DELETE_JOBPRINTER_CHANGE_WRITE_JOB

PRINTER_CHANGE_ADD_JOB PRINTER_CHANGE_SET_JOB PRINTER_CHANGE_DELETE_JOB PRINTER_CHANGE_WRITE_JOB

这篇关于PrintQueue中的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆