public override void Execute(PageBase page) { var csb = new SqlConnectionStringBuilder(ConnectionString); page.Response.Output.WriteLine( "Testing database connection to server: {0}, database: {1}", csb.DataSource, csb.InitialCatalog); var cn = new SqlConnection(ConnectionString); cn.Open(); page.Response.Output.WriteLine("Connected. Server version: {0}", cn.ServerVersion); }
public override void Execute(PageBase page) { var smtpclient = new SmtpClient(); page.Response.Output.WriteLine( "Sending e-mail message to {0}", EmailAddress); page.Response.Output.WriteLine("Delivery method: {0}", smtpclient.DeliveryMethod); page.Response.Output.WriteLine("Server: {0}:{1}", smtpclient.Host, smtpclient.Port); var subject = String.Format("{0} test message from {1}", page.Domain.ShortTitle, Environment.MachineName); var body = "Test message, please ignore."; var msg = EmailTemplateUtility.CreateMessage( page.Domain.Email, page.Domain.ShortTitle, EmailAddress, EmailAddress, subject, body); EmailTemplateUtility.SendMessage(msg); page.Response.Output.WriteLine("E-mail message sent."); }
public CheckRoutineExecutor(PageBase page) { InitializeMembers(); this.page = page; }
private void InitializeMembers() { this.page = null; this.routines = new List<CheckRoutineBase>(); this.handleExceptions = true; }
public abstract void Execute(PageBase page);