如果打印不成功,则在c#中回滚 [英] Rollback in c# if printing not successful

查看:114
本文介绍了如果打印不成功,则在c#中回滚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



在我的应用程序中,我将文本文件数据打印到打印机。

之后我发送了打印行的事务ID返回服务器,将其更新为打印。



请告诉我如何回滚打印的事务没有发生。 />
例如有时它会像纸张一样进入内部,但它会在没有打印任何内容的情况下返回,它也会用来更新数据库。



请帮我解决这个问题。

Hi all

In my application i am printing a text file data to a printer.
and after that i am sending the transaction id's of the printed lines back to the server to update them as printed.

Please tell me how to rollback the transactions of the printing didn't happens.
e.g. sometime it happens like the paper will go inside but it comes back without printing anything and it use to update the database also.

Please help me how to do this.

推荐答案





在despool期间Win32假脱机程序更新打印机和打印作业的状态打印作业。在所有其他时间,当该打印机没有解析并且没有报告状态信息时,打印机被认为是准备好并且空闲。



您可以获得打印机的状态,并根据该状态回滚您的交易,您可以提交交易。



请参阅以下链接:

http://support.microsoft.com/ kb / 160129 [ ^ ]



http:// msdn .microsoft.com / zh-CN / library / ms552937%28v = vs.90%29.aspx [ ^ ]



如需更详细的版本,看看这个:

监控打印机队列来自VB.NET [ ^ ]



希望这有帮助!! :) :)



问候,

Praneet
Hi,

The status of printers and print jobs are updated by the Win32 Spooler during the despool of a print job. At all other times, when that printer is not despooling and reports no state information, the printer is considered to be ready and idle.

You get the status of the printer and on the basis of which you can rollback your transaction else, you can commit your transaction.

See these links:
http://support.microsoft.com/kb/160129[^]

http://msdn.microsoft.com/en-us/library/ms552937%28v=vs.90%29.aspx[^]

For a more detailed version, check this out :
Monitoring a Printer Queue from VB.NET[^]

Hope this helps !! :) :)

Regards,
Praneet


这篇关于如果打印不成功,则在c#中回滚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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