Click here to Skip to main content
15,357,464 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problem with Windows forms monthcalendar control Pin
OriginalGriff26-Jul-14 21:33
mveOriginalGriff26-Jul-14 21:33 
GeneralRe: Problem with Windows forms monthcalendar control Pin
Pete O'Hanlon27-Jul-14 1:44
mvaPete O'Hanlon27-Jul-14 1:44 
GeneralRe: Problem with Windows forms monthcalendar control Pin
OriginalGriff27-Jul-14 2:29
mveOriginalGriff27-Jul-14 2:29 
GeneralRe: Problem with Windows forms monthcalendar control Pin
Member 1094245027-Jul-14 7:00
MemberMember 1094245027-Jul-14 7:00 
GeneralRe: Problem with Windows forms monthcalendar control Pin
OriginalGriff27-Jul-14 21:09
mveOriginalGriff27-Jul-14 21:09 
GeneralRe: Problem with Windows forms monthcalendar control Pin
Pete O'Hanlon26-Jul-14 21:34
mvaPete O'Hanlon26-Jul-14 21:34 
GeneralRe: Problem with Windows forms monthcalendar control Pin
OriginalGriff26-Jul-14 21:50
mveOriginalGriff26-Jul-14 21:50 
Questioncannot send text encryption via email Pin
KaKoten25-Jul-14 21:20
MemberKaKoten25-Jul-14 21:20 
how to add coding to send Encryption text via smtp mail and this is the code. thanks Smile | :) Smile | :)

private void SendMail_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "")
            {
                MessageBox.Show("Require, must content the row !!!");
            }
            else
                try
                {
                    obj_SMTPClient = new SmtpClient("smtp.gmail.com");
                    Obj_MailMsg = new MailMessage();
                    obj_Attachment = new System.Net.Mail.Attachment(textBox7.Text);
                    Obj_MailMsg.From = new MailAddress(textBox1.Text);
                    Obj_MailMsg.To.Add(textBox3.Text);
                    Obj_MailMsg.Body = textBox5.Text;
                    Obj_MailMsg.Attachments.Add(obj_Attachment);
                    Obj_MailMsg.Subject = textBox4.Text;
                    SmtpClient smtps = new SmtpClient("smtp.gmail.com", 587);
                    obj_SMTPClient.Credentials = new NetworkCredential();
                    obj_SMTPClient.Port = 587;
                    obj_SMTPClient.Credentials = new System.Net.NetworkCredential(textBox1.Text, textBox2.Text);
                    obj_SMTPClient.EnableSsl = true;
                    obj_SMTPClient.Send(Obj_MailMsg);
                    
                    obj_SMTPClient.EnableSsl = true;
                    obj_SMTPClient.Send(Obj_MailMsg);
                    MessageBox.Show("Message Successfuly Sent!!!");
                }
                catch
                {
                    MessageBox.Show("Failed to Send Message!!!");
                }
        }
		
		 private void EncryptionText_Click_1(object sender, EventArgs e)
        {
            cipherData = textBox6.Text;
            plainbytes = Encoding.ASCII.GetBytes(cipherData);
            // generating symmetric key
            desObj.GenerateKey();
            // generating vector
            desObj.GenerateIV();
            // choose other appropriate modes (CBC, CFB, CTS, ECB, OFB)
            desObj.Mode = CipherMode.CBC;
            // setting the padding mode
            desObj.Padding = PaddingMode.PKCS7;
            // --------------- ECRYPTION ---------------
            // memory stream used as a target to write enrypted data
            MemoryStream ms = new MemoryStream();
            // transforms and encrypts plaintext data to memorystream object
            CryptoStream cs = new CryptoStream(ms,
                desObj.CreateEncryptor(),
                CryptoStreamMode.Write);
            cs.Write(plainbytes, 0, plainbytes.Length);
            cs.Close();
            // getting encrypted data from memorystream to bytes
            cipherbytes = ms.ToArray();
            ms.Close();
            textBox5.Text = Encoding.ASCII.GetString(cipherbytes);
        }

        private void DecryptionText_Click_1(object sender, EventArgs e)
        {
            // --------------- DECRYPTION ---------------
            MemoryStream ms1 = new MemoryStream(cipherbytes);
            CryptoStream cs1 = new CryptoStream(ms1,
                desObj.CreateDecryptor(),
                CryptoStreamMode.Read);
            // allocate array of bytes equal on lenght with ciphertext array
            plainbytes = new Byte[cipherbytes.Length];
            // decrypt the ciphertext from previous section
            cs1.Read(plainbytes, 0, cipherbytes.Length);
            cs1.Close();
            ms1.Close();
            textBox5.Text = Encoding.ASCII.GetString(plainbytes);
        }

AnswerRe: cannot send text encryption via email Pin
OriginalGriff25-Jul-14 21:52
mveOriginalGriff25-Jul-14 21:52 
GeneralRe: cannot send text encryption via email Pin
KaKoten27-Jul-14 18:20
MemberKaKoten27-Jul-14 18:20 
AnswerRe: cannot send text encryption via email Pin
Eddy Vluggen25-Jul-14 23:45
professionalEddy Vluggen25-Jul-14 23:45 
GeneralRe: cannot send text encryption via email Pin
KaKoten26-Jul-14 22:16
MemberKaKoten26-Jul-14 22:16 
GeneralRe: cannot send text encryption via email Pin
Eddy Vluggen27-Jul-14 0:15
professionalEddy Vluggen27-Jul-14 0:15 
GeneralRe: cannot send text encryption via email Pin
KaKoten27-Jul-14 18:13
MemberKaKoten27-Jul-14 18:13 
GeneralRe: cannot send text encryption via email Pin
Eddy Vluggen28-Jul-14 2:54
professionalEddy Vluggen28-Jul-14 2:54 
GeneralRe: cannot send text encryption via email Pin
KaKoten28-Jul-14 11:54
MemberKaKoten28-Jul-14 11:54 
GeneralRe: cannot send text encryption via email Pin
Eddy Vluggen28-Jul-14 12:17
professionalEddy Vluggen28-Jul-14 12:17 
GeneralRe: cannot send text encryption via email Pin
KaKoten28-Jul-14 16:53
MemberKaKoten28-Jul-14 16:53 
QuestionC# File to Dictionary Lookup Pin
Member 1094881825-Jul-14 14:35
MemberMember 1094881825-Jul-14 14:35 
GeneralRe: C# File to Dictionary Lookup Pin
PIEBALDconsult25-Jul-14 14:50
professionalPIEBALDconsult25-Jul-14 14:50 
GeneralRe: C# File to Dictionary Lookup Pin
Member 1094881825-Jul-14 16:51
MemberMember 1094881825-Jul-14 16:51 
Questionread value from item array in user control Pin
Jassim Rahma25-Jul-14 9:18
MemberJassim Rahma25-Jul-14 9:18 
AnswerRe: read value from item array in user control Pin
Gerry Schmitz25-Jul-14 11:19
mveGerry Schmitz25-Jul-14 11:19 
GeneralRe: read value from item array in user control Pin
Jassim Rahma25-Jul-14 12:42
MemberJassim Rahma25-Jul-14 12:42 
GeneralRe: read value from item array in user control Pin
Gerry Schmitz25-Jul-14 14:09
mveGerry Schmitz25-Jul-14 14:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.