Click here to Skip to main content
15,358,266 members
Home / Discussions / C#
   

C#

 
QuestionCould someone answer me this Pin
Member 1094467914-Jul-14 0:25
MemberMember 1094467914-Jul-14 0:25 
AnswerRe: Could someone answer me this Pin
Pete O'Hanlon14-Jul-14 1:40
mvaPete O'Hanlon14-Jul-14 1:40 
QuestionSend command To Printe Pin
Zeyad Jalil12-Jul-14 21:15
professionalZeyad Jalil12-Jul-14 21:15 
SuggestionRe: Send command To Printe Pin
Richard MacCutchan12-Jul-14 21:33
mveRichard MacCutchan12-Jul-14 21:33 
GeneralRe: Send command To Printe Pin
Zeyad Jalil12-Jul-14 22:09
professionalZeyad Jalil12-Jul-14 22:09 
GeneralRe: Send command To Printe Pin
Richard MacCutchan12-Jul-14 22:20
mveRichard MacCutchan12-Jul-14 22:20 
GeneralRe: Send command To Printe Pin
Dave Kreskowiak13-Jul-14 4:40
mveDave Kreskowiak13-Jul-14 4:40 
QuestionAdd other component in c# 2008 Pin
KaKoten12-Jul-14 15:30
MemberKaKoten12-Jul-14 15:30 
I want to adding another component including timer.tick, progressbar and backroundworker, how do i adding the component to process mailsend and this is the code, thanks:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net.Mail;
using System.Net;


namespace Mail_Send
{
    public partial class Form4 : Form
    {
        SmtpClient obj_SMTPClient;
        MailMessage Obj_MailMsg;
        Attachment obj_Attachment;
        //string pBar;
       
        
        public Form4()

        {
            InitializeComponent();            
        }
        
        private void Form4_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog open = new OpenFileDialog();
            if (open.ShowDialog() == DialogResult.OK)
            {
                label3.Text = open.FileName;
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void SendMail_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "")
            {
                MessageBox.Show("please fill, don't let a column blank!!!");
            }
            else
                try
                {
                    obj_SMTPClient = new SmtpClient("smtp.gmail.com");
                    Obj_MailMsg = new MailMessage();
                    obj_Attachment = new System.Net.Mail.Attachment(label3.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 Successful sent!!!");
                }
                catch
                {
                    MessageBox.Show("Sorry, Request TimeOut!!!");
                }
        } 

        private void button4_Click(object sender, EventArgs e)
        {
                
        }     
     
         
    

        private void button8_Click(object sender, EventArgs e)
        {
            foreach (Control sayre in this.Controls)
            {
                if (sayre is TextBox)
                {
                    (sayre as TextBox).Clear();
                }
            } 
        }

        private void button6_Click(object sender, EventArgs e)
        {
           
        }

        private void button5_Click(object sender, EventArgs e)
        {
           
        }

        private void button4_Click_1(object sender, EventArgs e)
        {
            foreach (Control sayre in this.Controls)
            {
                if (sayre is TextBox)
                {
                    (sayre as TextBox).Clear();
                }
            }  
        }       
        
        
        }
    }  


modified 12-Jul-14 21:38pm.

AnswerRe: Add other component in c# 2008 Pin
Richard MacCutchan12-Jul-14 21:28
mveRichard MacCutchan12-Jul-14 21:28 
QuestionMutliple ResultSet from Stored Procedure using EF 5.0 Pin
meeram3912-Jul-14 12:57
professionalmeeram3912-Jul-14 12:57 
AnswerRe: Mutliple ResultSet from Stored Procedure using EF 5.0 Pin
Dave Kreskowiak13-Jul-14 4:42
mveDave Kreskowiak13-Jul-14 4:42 
GeneralRe: Mutliple ResultSet from Stored Procedure using EF 5.0 Pin
meeram3913-Jul-14 8:39
professionalmeeram3913-Jul-14 8:39 
QuestionTranslate method in Entity framework not found Pin
meeram3912-Jul-14 7:53
professionalmeeram3912-Jul-14 7:53 
AnswerRe: Translate method in Entity framework not found Pin
Pete O'Hanlon12-Jul-14 8:54
mvaPete O'Hanlon12-Jul-14 8:54 
GeneralRe: Translate method in Entity framework not found Pin
meeram3912-Jul-14 9:52
professionalmeeram3912-Jul-14 9:52 
QuestionSelf Hosted WCF + REST + CORS Pin
evolcoder11-Jul-14 22:10
Memberevolcoder11-Jul-14 22:10 
AnswerRe: Self Hosted WCF + REST + CORS Pin
OriginalGriff11-Jul-14 22:37
mveOriginalGriff11-Jul-14 22:37 
AnswerRe: Self Hosted WCF + REST + CORS Pin
Rob Philpott11-Jul-14 22:39
MemberRob Philpott11-Jul-14 22:39 
GeneralRe: Self Hosted WCF + REST + CORS Pin
evolcoder14-Jul-14 17:16
Memberevolcoder14-Jul-14 17:16 
Questionexe of C# file. Pin
Mehmood Ali Biswas11-Jul-14 21:36
MemberMehmood Ali Biswas11-Jul-14 21:36 
AnswerRe: exe of C# file. Pin
OriginalGriff11-Jul-14 22:36
mveOriginalGriff11-Jul-14 22:36 
AnswerRe: exe of C# file. Pin
Rob Philpott11-Jul-14 22:37
MemberRob Philpott11-Jul-14 22:37 
QuestionImport XML file without stylesheet Pin
Richard.Berry10011-Jul-14 19:01
MemberRichard.Berry10011-Jul-14 19:01 
SuggestionRe: Import XML file without stylesheet Pin
Richard MacCutchan11-Jul-14 21:35
mveRichard MacCutchan11-Jul-14 21:35 
GeneralRe: Import XML file without stylesheet Pin
Richard.Berry10012-Jul-14 18:17
MemberRichard.Berry10012-Jul-14 18:17 

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.