从 Windows 服务打印 [英] Printing from a Windows Service

查看:24
本文介绍了从 Windows 服务打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不需要任何用户交互的情况下从 Windows 服务在特定打印机上打印文档?

How can I printing a document on a specific printer from a Windows-Service without the need of any user-interaction?

一个字符串或一个文本文件.也许水晶报表?

A string, or a text-file. Maybe Crystalreport?

谢谢.

推荐答案

重点不在于如何从 Windows 服务或应用程序打印,如果您不希望需要任何用户交互,则必须指定所有无需显示打印对话框即可打印参数(您不能这样做,因为 Windows 服务无法访问 UI).

The point is not how to print from a windows service or from an application, if you don't want any user interaction to be required you have to specify all print parameters without any need to show a print dialog ( which you can't because a windows service has no access to the UI ).

请参阅此处:http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.aspx

这篇关于从 Windows 服务打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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