www.pudn.com > IntMail.rar > FrmRegUserPass.cs


using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Text; 
using System.Windows.Forms; 
 
namespace IntMail.RegMail 
{ 
    public partial class FrmRegUserPass : Form 
    { 
        public FrmRegUserPass() 
        { 
            InitializeComponent(); 
        } 
        int frmCount = 0; 
        private void button2_Click(object sender, EventArgs e) 
        { 
            try 
            { 
                MailAddress.MailAddressUser = textBox1.Text.Trim(); 
                MailAddress.MailAddressPass = textBox2.Text; 
                frmCount = 1; 
                FrmRegOK _fmOk = new FrmRegOK(); 
                _fmOk.Show(); 
                this.Close(); 
            } 
            catch (Exception ex) 
            { 
                MessageBox.Show(ex.Message); 
            } 
 
        } 
 
        private void FrmRegUserPass_FormClosing(object sender, FormClosingEventArgs e) 
        { 
            if (frmCount == 0) 
            { 
                Application.Exit(); 
            } 
        } 
 
        private void button1_Click(object sender, EventArgs e) 
        { 
            frmCount = 1; 
            RegMail.FrmRegMailServer _fmServer = new FrmRegMailServer(); 
            _fmServer.Show(); 
            this.Close(); 
        } 
 
        private void FrmRegUserPass_Load(object sender, EventArgs e) 
        { 
            try 
            { 
                if (MailAddress.MailAddressUser != null) 
                { 
                    textBox1.Text = MailAddress.MailAddressUser; 
                } 
                else 
                { 
                    textBox1.Text = ""; 
                } 
                if (MailAddress.MailAddressPass != null) 
                { 
                    textBox2.Text = MailAddress.MailAddressPass; 
                } 
                else 
                { 
                    textBox2.Text = ""; 
                } 
            } 
            catch (Exception ex) 
            { 
                textBox1.Text = ""; 
                textBox2.Text = ""; 
            } 
        } 
    } 
}