Click here to Skip to main content
15,904,497 members
Home / Discussions / C#
   

C#

 
Questionhow do i get a table in gridview according to combobox fields? Pin
Sajeev Unni27-Jul-14 7:29
Sajeev Unni27-Jul-14 7:29 
AnswerRe: how do i get a table in gridview according to combobox fields? Pin
Pete O'Hanlon27-Jul-14 8:09
mvePete O'Hanlon27-Jul-14 8:09 
AnswerRe: how do i get a table in gridview according to combobox fields? Pin
Swinkaran28-Jul-14 19:09
professionalSwinkaran28-Jul-14 19:09 
QuestionMVC unit testing Pin
Marsh8727-Jul-14 3:09
Marsh8727-Jul-14 3:09 
AnswerRe: MVC unit testing Pin
Pete O'Hanlon27-Jul-14 3:41
mvePete O'Hanlon27-Jul-14 3:41 
AnswerRe: MVC unit testing Pin
Marsh8727-Jul-14 8:52
Marsh8727-Jul-14 8:52 
GeneralRe: MVC unit testing Pin
Pete O'Hanlon27-Jul-14 10:02
mvePete O'Hanlon27-Jul-14 10:02 
GeneralRe: MVC unit testing PinPopular
Dave Kreskowiak27-Jul-14 10:03
mveDave Kreskowiak27-Jul-14 10:03 
GeneralRe: MVC unit testing Pin
User 571134828-Jul-14 0:54
User 571134828-Jul-14 0:54 
QuestionMouse set in the form Pin
PozzaVecia27-Jul-14 1:47
PozzaVecia27-Jul-14 1:47 
AnswerRe: Mouse set in the form Pin
Pete O'Hanlon27-Jul-14 1:53
mvePete O'Hanlon27-Jul-14 1:53 
GeneralRe: Mouse set in the form Pin
PozzaVecia27-Jul-14 2:13
PozzaVecia27-Jul-14 2:13 
AnswerRe: Mouse set in the form Pin
OriginalGriff27-Jul-14 2:34
mveOriginalGriff27-Jul-14 2:34 
AnswerRe: Mouse set in the form Pin
User 873938130-Jul-14 23:44
User 873938130-Jul-14 23:44 
GeneralProblem with Windows forms monthcalendar control Pin
Member 1094245026-Jul-14 19:17
Member 1094245026-Jul-14 19:17 
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
mvePete 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
Member 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
mvePete 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
KaKoten25-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
KaKoten27-Jul-14 18:20 

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.