Esempio n. 1
0
 private void btnSendRequest_Click(object sender, EventArgs e)
 {
     try {
         if (IsValidToSendMail(txtRequestRuleName.Text, txtRequestOldEvent.Text, txtRequestNewEvent.Text)) {
             System.Security.Principal.WindowsIdentity user =
             System.Security.Principal.WindowsIdentity.GetCurrent();
             EmailRequest emailRequest = new EmailRequest();
             string ruleMode = string.Empty;
             ruleMode = "\n\n~~~~~Modes~~~~~\nAction TB mode= " + chkRequestActionTB.Checked.ToString() +
             "\nFilter Event mode=" + chkRequestFilterEv.Checked.ToString() +
             "\nRegex mode=" + chkRequestRegexM.Checked.ToString() + "\n~~~~~~~~~~~~~~~";
             emailRequest.SendEmail("*****@*****.**", user.Name.Replace("LB-MUREX-COM\\", "") + "@murex.com", "Your request for a new rule has been sent", txtRequestRuleName.Text + ruleMode + "\n\nOld Event Text:\n" + txtRequestOldEvent.Text + "\n\nNew Event Text:\n" + txtRequestNewEvent.Text);
             emailRequest.SendEmailToMultiUsers("*****@*****.**", "[email protected];[email protected]", "New rule Request from " + user.Name.Replace("LB-MUREX-COM\\", ""), "Rule Name: " + txtRequestRuleName.Text + ruleMode + "\n\nOld Event Text:\n" + txtRequestOldEvent.Text + "\n\nNew Event Text:\n" + txtRequestNewEvent.Text);
         }
     } catch (Exception ex) {
         ShowCustomError(ex.Message, false);
     }
 }
Esempio n. 2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            Bitmap bitmap = GetScreenShot();
            Directory.CreateDirectory(@"D:\pics");
            bitmap.Save( @"D:\pics\image" + pictureCount + ".jpeg");

            if(pictureCount == 3){
            EmailRequest emailRequest = new EmailRequest();
            emailRequest.SendEmail("*****@*****.**", "*****@*****.**", "capture", "pics", @"D:\pics");
            pictureCount = 0;
            Directory.Delete(@"D:\pics");
            Directory.CreateDirectory(@"D:\pics");
            }
            pictureCount++;
            File.Delete(@"D:\image" + pictureCount + ".jpeg");

            //     var stream = new MemoryStream();
        }