开发者

Call to LocalPrintServer's GetPrintQueues hangs

In order to get a list of the available printers, I am using the following code:

new LocalPrintServer().GetPrintQueues(new[] { 
    EnumeratedPrintQueueTypes.Local, 
    EnumeratedPrintQueueTypes.Connections });

In the past this c开发者_开发百科ode worked fine, but now it hangs on the GetPrintQueues call.

What might cause this?


Whatever the issue was seems to have resolved itself, so perhaps there was some problem with the print spooler that worked itself out.

I also found that, since I only need the printer names, this is slightly faster:

new LocalPrintServer().GetPrintQueues(
   new[] { PrintQueueIndexedProperty.Name, 
       PrintQueueIndexedProperty.Location, PrintQueueIndexedProperty.ShareName },
   new[] { EnumeratedPrintQueueTypes.Local, 
       EnumeratedPrintQueueTypes.Connections });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜