Exemplo n.º 1
0
        public EmailAccount(string accountName, Settings settings)
        {
            InitializeComponent();
            this.accountName = accountName;
            this.settings = settings;
            MySqlConnection connection = CoreFeature.getInstance().getDataConnection();
            MySqlCommand cmd = connection.CreateCommand();
            cmd.CommandText = "select * from account where name='" + accountName  + "'";
            cmd.CommandType = CommandType.Text;
            MySqlDataReader rdr = cmd.ExecuteReader();

            if (rdr.Read())
            {
                txtName.Text = rdr.GetString(rdr.GetOrdinal("name"));
                txtServer.Text = rdr.GetString(rdr.GetOrdinal("server"));
                txtPort.Value = rdr.GetInt32(rdr.GetOrdinal("port"));
                chkUseSSL.Checked = rdr.GetByte(rdr.GetOrdinal("use_ssl"))==1;
                txtUsername.Text = rdr.GetString(rdr.GetOrdinal("username"));
                txtPassword.Text = Cryptho.Decrypt(rdr.GetString(rdr.GetOrdinal("password")));
                chkActive.Checked = rdr.GetByte(rdr.GetOrdinal("active")) == 1;
            }

            cmd.Dispose();
            rdr.Close();
            connection.Close();
        }
Exemplo n.º 2
0
 private void OnSettings(object sender, EventArgs e)
 {
     Settings frmSettings = new Settings();
     frmSettings.ShowDialog();
     frmSettings.Dispose();
 }