生成pdf时的backgroundworker [英] backgroundworker while generating pdf
本文介绍了生成pdf时的backgroundworker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我正在生成pdf文件,该文件将存储在路径中,并提及如何使用后台工作人员完成任务.其Winforms c#
Hello,
I am generating pdf which will get stored in a path mention how can i use background worker to accomplished the task. Its Winforms c#
推荐答案
在MSDN上的示例中,您可以了解BackgroundWorker的工作方式: ^ ].您将挂接到backgroundworker的DoWork
和RunWorkerCompleted
事件处理程序将首当其冲.您必须确保处理和/或保存方法封装在您应定义的类中.这样,您就不会污染您的代码,并且所有内容都可以整齐地分开.它还可以使您更轻松地在前端跟踪处理和保存的进度,尤其是在任何时候有多个进程正在进行的情况下.
问候,
曼弗雷德(Manfred)
In a sample on MSDN you can learn how a BackgroundWorker operates: How to: Run an Operation in the Background[^]. TheDoWork
andRunWorkerCompleted
event handlers you''ll hook up to the backgroundworker will do the brunt of the work. You''ll have to make sure though that the processing and/or save method is encapsulated in a class you should define. That way you won''t pollute your code and everything is neatly separated. It will also make it easier for you to track the progress of the processing and saving in the front end, especially when there is more than one process going on at any one time.
Regards,
Manfred
这篇关于生成pdf时的backgroundworker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文