private void Timer1_Tick(object sender, EventArgs e) { Process[] p = Process.GetProcesses(); foreach (Process item in p) { if (item.MainWindowTitle != "" && !item.MainWindowTitle.ToLower().Replace(' ', '.').Contains(prev.ToLower())) { foreach (var ban in _bans) { if (item.MainWindowTitle.ToLower().Contains(ban.Name.ToLower())) { string mailAdress = _mailManager.FirstMail().Adress; MailTool.Send(mailAdress, item.MainWindowTitle); _reportManager.Add(new Report() { DateTime = DateTime.Now, SiteTitle = item.MainWindowTitle, BanID = ban.Id }); prev = ban.Name; item.Kill(); } } } } }
private void BtnSave_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtMail.Text)) { var mail = _mailManager.FirstMail(); mail.Adress = txtMail.Text; var result = _mailManager.Update(mail); if (result) { MessageBox.Show("Mail adresiniz başarıyla güncellendi."); txtMail.Clear(); } else { MessageBox.Show("Mail adresiniz güncellenemedi."); } } else { MessageBox.Show("Mail adres alanı boş geçilemez."); } }
public ActionResult Index() { return(View(_mailManager.FirstMail())); }