Last post Sep 23, 2016 02:57 AM by Deepak Panchal
Sep 22, 2016 10:10 AM|mazhar khan india|LINK
I have one online test website and I want to capture screenshot at Defined Time Intervals Automatically using asp.net c# web forms and I need sample code using single .aspx page using sql.
I go through the following links but getting confused.
Sep 22, 2016 11:40 AM|mgebhard|LINK
You're facing a fundamental issue. In ASP C# runs on a web server not the client machine. Therefore, C# is not an option for capturing a screenshot.
It is possible to capture the HTML response from an HTTP request. Then you can store the HTML in a database table.
Sep 22, 2016 12:45 PM|mazhar khan india|LINK
Thank you for your valuable replied.
I got URL as you said want to stored as a Images into folder, can you give code for that.
public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
public void getimage()
WebClient myClient = new WebClient();
string myPageHTML = null;
// Gets the url of the page
string currentPageUrl = Request.Url.ToString();
UTF8Encoding utf8 = new UTF8Encoding();
// by setting currentPageUrl to www.yahoo.com it will fetch the source (html)
// of the yahoo.com and put it in the myPageHTML variable.
currentPageUrl = "http://localhost:493421/mypage.aspx";
requestHTML = myClient.DownloadData(currentPageUrl);
myPageHTML = utf8.GetString(requestHTML);
Thank you very much
Sep 22, 2016 01:01 PM|mgebhard|LINK
Do an internet search for "Convert HTML to Image"
Sep 22, 2016 01:24 PM|mazhar khan india|LINK
If I will convert html to image, I will get sure above my question requirement.
Thank you Regards
Sep 23, 2016 02:57 AM|Deepak Panchal|LINK
Hi Mazhar khan,
you can find the suggestion and demo code in your other thread that you had created for the same issue.