ASP.NET应用程序日志,而code运行时/进度条 [英] ASP.NET Application log while code is running / progress bar
问题描述
我要建一个OCR扫描模块在我的ASP形式的web应用。正如你可能知道,这样的操作可能需要一些时间。为此我使用的回应在运行code,因此用户甚至没有留在同一个网页上的消息队列后台服务的应用程序。
I’m building a OCR scanning module in my ASP forms webapplication. As you may know a operation like that can take some time. Therefor I’m using a background service application that responds to a message queue that runs the code so the user does not even have to stay on the same webpage.
我想要做的就是告知用户是怎么回事,该服务运行时。如果可以说用户上传的5号文件,我想看到这样的事情出现在字面,标签或中继器的控制。这些项目没有保存在数据库中,我不想再要。
5
处理文档1
1文件处理与code 6732842
5
处理文档2
文献2处理用code 8732457
5
处理文档3
文献3处理与code 8725347
5
处理文档4
4文档无法处理不OCR识别字符串
5
处理文档5
文件5加工与code 4372537
完成:收到4分处理的文档
What I would like to do is inform the user what is going on while the service is running. If lets say the user uploaded 5 documents I would like to see something like this appear in a literal, label or repeater control. These items do not have to be saved in a database and I don’t want then to.
Processing document 1 of 5
Document 1 processed with code 6732842
Processing document 2 of 5
Document 2 processed with code 8732457
Processing document 3 of 5
Document 3 processed with code 8725347
Processing document 4 of 5
Document 4 could not be processed "no OCR string recognized"
Processing document 5 of 5
Document 5 processed with code 4372537
Completed: Processed 4 of 5 documents received
如果错误发生,我想看到这样的事情
If an error occurred I would like to see something like this
时发生错误。扫描过程已停止。
我有一些idears但我不知道什么是最好的做法。
I have some idears but I don’t know what’s the best practice.
选项1:
我可以节省上述项目的静态类,让JavaScript的后每5秒。要得到
通过网络方法的价值。
Option 1:
I could save above items in a static class and let javascript post every 5 sec. to get
that value via a web method.
选项2:
我可以节省上述项目在会话返回一个更新的会话对象时,我让的JavaScript后每5秒。我不知道,如果使用的服务应用程序时,这是可用的。
Option 2:
I could save above items in the session returning a updated session object when I let JavaScript post every 5 sec. I don’t know if this is available when using a service Application.
如果您有任何其他选项(preferably更好的),这将大大appriciated。
If you have any other options (preferably better ones) that would be greatly appriciated.
感谢名单提前。
推荐答案
保存进度的项目在数据库中,给每个用户的上传与不同的ID,与Web服务发布这些数据。在浏览器中,使用javascipt的检索来自web服务的进展。
当然,数据库需要定期删除,例如,每隔minitue
Save the progress items in a database , give each user's upload with a different id, publish this data with a web service. In the browser, use JavaScipt to retrieve the progress from the web service.
Of course, the database need to delete periodically, e.g., every minitue.
这篇关于ASP.NET应用程序日志,而code运行时/进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!