using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.Threading; namespace PictureClient { public partial class PictureClient : System.Web.UI.Page { com.harbormist.PictureService websvc = null; //com.harbormist.PictureService protected void Page_Load(object sender, System.EventArgs e) { websvc = new com.harbormist.PictureService(); } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { InitializeComponent(); base.OnInit(e); } private void InitializeComponent() { } #endregion protected void ButtonRandomGet_Click(object sender, System.EventArgs e) { string img = websvc.GetPicture(); if (img!=null) { // update background image this.Label1.Text = "Updating..."; this.bodyElement.Attributes["background"] = img; Thread.Sleep(1500); this.Label1.Text = "Background picture updated "; this.Label2.Text = img; } else { this.Label1.Text= "No picture found"; } } } }