码迷,mamicode.com
首页 > 其他好文 > 详细

PrintQueue

时间:2015-01-23 16:01:41      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:

PrintQueueCollection printQueues = null;

var printServer = new PrintServer();
printQueues = printServer.GetPrintQueues(new[] { EnumeratedPrintQueueTypes.Local, EnumeratedPrintQueueTypes.Connections });
PrintQueue printQueue = printQueues.FirstOrDefault(p => p.Name.ToUpperInvariant().Contains(PrintName.ToUpperInvariant()));
if (printQueue != null)
{
      try
      {
            var jobs = printQueue.GetPrintJobInfoCollection().Count(j => j.JobStatus != PrintJobStatus.Completed);
            if (jobs == 0)
            {
          //print done
break; } } catch {
      //sometimes will happen } }

 

PrintQueue

标签:

原文地址:http://www.cnblogs.com/yipeng-yu/p/4244236.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!