如果出现错误,如何捕获 Web 应用程序屏幕以附加到电子邮件?
我正在开发一个 Web 应用程序,我们希望捕获屏幕(应用程序当前屏幕或整个屏幕)并将其附加到自动生成的错误消息电子邮件中。我看过一些关于如何在 winform 应用程序中执行此操作的帖子,但没有真正了解如何在 Web 应用程序中执行此操作。是同样的过程吗?任何提供有关如何在网络应用程序中实现此目的的有用步骤的网站都将受到赞赏。
编辑: 我们是否有可能通过屏幕抓取来实现类似的效果?我不太熟悉屏幕抓取可以做什么,所以也欢迎任何建议。
I am working on a web application and we would like to capture the screen (either the applications current screen or the whole screen) and attach this to an e-mail that is automatically generated for error messages. I've seen a few posts about how to do this in a winform app, but nothing really on how to do it in a web app. Is it the same process? Any sites that have helpful steps on how to achieve this in a web app are appreciated.
EDIT:
Is it possible for us to achieve something similar with screen scraping? I'm not too familiar with what all can be done with a screen scrape so any suggestions are also welcomed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Web 应用程序中没有
屏幕
。您必须在客户端计算机上执行此操作,客户端计算机具有能够将 HTML 转换为某些值得捕获的界面的浏览器。您可以在 Web 应用程序中执行的操作是注册 Application_Error global.asax 中的事件并为每个异常发送一封电子邮件。
There's no
screen
in a web application. You have to do this on the client machine, who has a browser capable of transforming the HTML to some interface worth capturing.What you could do in your web application is to register for the Application_Error event in global.asax and send an email for each exception.
使用 Server.GetLastError() 捕获错误并将其发送给管理员而不是这样的屏幕截图更有意义
instead of such screen shot, using Server.GetLastError() to capture the error and sending to admins has more meaning
不太懂 .NET,但是,应该有某种方法可以在异常捕获代码中获取 Response 对象,然后在电子邮件中包含它的序列化表示。像标题和会话变量之类的东西也很有用,FWIW...
Not much of a .NET guy but, there should be some way to get the Response object in your exception catching code and then include a serialized representation of it in your email. Things like headers and session variables are also useful, FWIW...