Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (File.Exists(Application.StartupPath + "\\foto.jpg") == true)
            {
                pictureBox1.Image.Dispose();
                File.Delete(Application.StartupPath + "\\foto.jpg");
            }

            string error;
            Ad     ad = new Ad();

            TabelLibrary.Data.DataAd data = ad.Getsettings(out error);
            if (error == "")
            {
                pictureBox1.Image = Image.FromFile(Application.StartupPath + "\\foto.jpg");

                from.Text       = data.Email;
                to.Text         = data.EmailBoss;
                smtpserver.Text = "smtp.sintek-nn.ru";
                username.Text   = data.Email;
                password.Text   = "";
                subject.Text    = "Табель от " + data.FullName;
                message.Text    = "Табель от " + data.FullName;
            }
            else
            {
                MessageBox.Show(error);
            }
        }