private void btnExecute_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(this.smtpTextBox.Text) && !string.IsNullOrEmpty(this.portTextBox.Text) && !string.IsNullOrEmpty(this.smtpuserTextBox.Text) && !string.IsNullOrEmpty(this.smtppwdTextBox.Text)) { this.m_sendSNTPMail = new SMTPMail(server: this.smtpTextBox.Text, port: Int32.Parse(this.portTextBox.Text), useSsl: this.checkBox2.Checked, username: this.smtpuserTextBox.Text, pwd: this.smtppwdTextBox.Text, logger: this.m_logger); } else { this.m_logger.WriteLog("Send mail is not configured."); return; } this.m_logger.WriteLog("Navigate to login form"); this.webBrowser1.DocumentCompleted += WebBrowser1_startLoad; this.webBrowser1.Navigate(urlTextBox.Text); Application.DoEvents(); }
private void btnSendTestMessage_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(smtpTextBox.Text) && !string.IsNullOrEmpty(portTextBox.Text) && !string.IsNullOrEmpty(smtpuserTextBox.Text) && !string.IsNullOrEmpty(smtppwdTextBox.Text)) { this.m_sendSNTPMail = new SMTPMail(server: smtpTextBox.Text, port: Int32.Parse(portTextBox.Text), useSsl: checkBox2.Checked, username: smtpuserTextBox.Text, pwd: smtppwdTextBox.Text, logger: this.m_logger); } else { this.m_logger.WriteLog("Send mail is not configured."); return; } if (!string.IsNullOrEmpty(emailTextBox.Text) && !string.IsNullOrEmpty(toTextBox.Text)) { m_sendSNTPMail.SendTestMessage(emailTextBox.Text, toTextBox.Text); } else { this.m_logger.WriteLog("Parameters From: and To: are required"); } }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { this.m_historyTasks = null; this.m_currentTasks = null; this.m_needAllerts = null; this.m_logger.WriteLog("Close application"); this.m_logger.Close(); this.m_logger = null; this.m_conf = null; this.m_parser = null; this.m_sendSNTPMail = null; }