Hit REFRESH to show the latest image.
ASP.Net code used to save the image (C#)...
using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.IO;
namespace DXStudio.examples { /// <summary> /// Summary description for showscreenshot. /// </summary> public class showscreenshot : System.Web.UI.Page { protected System.Web.UI.WebControls.Image Image1; private void Page_Load(object sender, System.EventArgs e) { string strdata = (string) Request["screenshot"]; if (strdata != null) { strdata=strdata.Replace(" ","+"); // important - base64 + is changed to a space by post byte [] data=Convert.FromBase64String(strdata);
// for this example - save the binary data to a file... (you will need to set the directory and have write permission) FileStream fs=File.Open("c:\\inetpub\\dxstudio\\examples\\latestshot.jpg", FileMode.Create, FileAccess.Write, FileShare.None); fs.Write(data,0,data.Length); fs.Close(); Response.End(); } Response.Cache.SetNoStore(); Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Expires=0; }
#region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load);
} #endregion } }