Get a screenshot from an ASP.Net page

跟風遠走 提交于 2019-12-04 12:26:22

问题


I have an ASP.Net page that has a button that when clicked I would like to take a screenshot of the user's PC and send it to a server.

I'm ok with writing some sort of listener program to run on the server to accept requests to receive these images. Where I'm a bit hazy is the best way to get the user's PC to send the screenshot. Would this need to be done by writing some sort of Active X control for the ASP.Net page? It needs to be cross browser and operating system if possible.

Just a point in the right direction and what technologies I should use would be great. I would rather write this functionality myself if possible than use an out of the box solution as I can see that this functionality may be extended in the future. How does something like WebEx or copilot manage this?

Thanks

Gavin

Edit : Just to make it clear I'm not trying to steal information from a users PC, They would have to allow this functionality, Its more from a support point of view so when a clients having issues they can send a screenshot of the page they are on.


回答1:


If it needs to be cross-browser and all, you should take a look at Java(applets). It may sound old fashion but I think it's your best option. ActiveX works on windows/IE only ;)

For starters, take a look at this question, which is quite similar: Is there a way to take a screenshot using Java and save it to some sort of image?




回答2:


ActiveX would work. I suspect you might be able to do something in Silverlight, Flash, or Java applet as well (which would be more cross-browser friendly).

As for copilot, it is running in a stand alone executable that the each user downloads and runs. So it's not confined to typical browser limitations.




回答3:


It is just the web page you want a snap shot of?

Then you can access the entire pages rendered html from the javascript document object and send it to a web service along with browser type etc. No ActiveX install required :-)




回答4:


I use WebsitesScreenshot component to capture website screenshot or thumbnail image. This .NET Component is very easy to use. I love this component. http://www.websitesscreenshot.com/

Sample code:

WebsitesScreenshot.WebsitesScreenshot _Obj;
_Obj = new WebsitesScreenshot.WebsitesScreenshot();

WebsitesScreenshot.WebsitesScreenshot.Result _Result;
_Result = _Obj.CaptureWebpage("http://www.msn.com");

if (_Result == WebsitesScreenshot.WebsitesScreenshot.Result.Captured)
{
    _Obj.ImageWidth = 200;
    _Obj.ImageHeight = 300;
    _Obj.ImageFormat = WebsitesScreenshot.WebsitesScreenshot.ImageFormats.PNG;
    _Obj.SaveImage("c:\\msn.png");
}
_Obj.Dispose();


来源:https://stackoverflow.com/questions/629298/get-a-screenshot-from-an-asp-net-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!