private void btnSalvar_Click(object sender, EventArgs e) { var ret = ACBrMail.MAIL_ConfigGravarValor("Email".ToUTF8(), "Nome".ToUTF8(), txtNome.Text.ToUTF8()); ACBrMail.CheckResult(ret); ret = ACBrMail.MAIL_ConfigGravarValor("Email".ToUTF8(), "Conta".ToUTF8(), txtEmail.Text.ToUTF8()); ACBrMail.CheckResult(ret); ret = ACBrMail.MAIL_ConfigGravarValor("Email".ToUTF8(), "Usuario".ToUTF8(), txtUsuario.Text.ToUTF8()); ACBrMail.CheckResult(ret); ret = ACBrMail.MAIL_ConfigGravarValor("Email".ToUTF8(), "Senha".ToUTF8(), txtSenha.Text.ToUTF8()); ACBrMail.CheckResult(ret); ret = ACBrMail.MAIL_ConfigGravarValor("Email".ToUTF8(), "Servidor".ToUTF8(), txtHost.Text.ToUTF8()); ACBrMail.CheckResult(ret); ret = ACBrMail.MAIL_ConfigGravarValor("Email".ToUTF8(), "Porta".ToUTF8(), nudPorta.Text.ToUTF8()); ACBrMail.CheckResult(ret); ret = ACBrMail.MAIL_ConfigGravarValor("Email".ToUTF8(), "SSL".ToUTF8(), Convert.ToInt32(ckbSSL.Checked).ToString().ToUTF8()); ACBrMail.CheckResult(ret); ret = ACBrMail.MAIL_ConfigGravarValor("Email".ToUTF8(), "TLS".ToUTF8(), Convert.ToInt32(ckbTLS.Checked).ToString().ToUTF8()); ACBrMail.CheckResult(ret); ret = ACBrMail.MAIL_ConfigGravar("".ToUTF8()); ACBrMail.CheckResult(ret); }
private void btnSalvar_Click(object sender, EventArgs e) { try { string eSessao = "Email".ToUTF8(); int ret = ACBrMail.MAIL_ConfigGravarValor(eSessao, "Nome".ToUTF8(), txtNome.Text.ToUTF8()); ACBrMail.CheckResult(ret); ret = ACBrMail.MAIL_ConfigGravarValor(eSessao, "Conta".ToUTF8(), txtEmail.Text.ToUTF8()); ACBrMail.CheckResult(ret); ret = ACBrMail.MAIL_ConfigGravarValor(eSessao, "Usuario".ToUTF8(), txtUsuario.Text.ToUTF8()); ACBrMail.CheckResult(ret); ret = ACBrMail.MAIL_ConfigGravarValor(eSessao, "Senha".ToUTF8(), txtSenha.Text.ToUTF8()); ACBrMail.CheckResult(ret); ret = ACBrMail.MAIL_ConfigGravarValor(eSessao, "Servidor".ToUTF8(), txtHost.Text.ToUTF8()); ACBrMail.CheckResult(ret); ret = ACBrMail.MAIL_ConfigGravarValor(eSessao, "Porta".ToUTF8(), nudPorta.Text.ToUTF8()); ACBrMail.CheckResult(ret); ret = ACBrMail.MAIL_ConfigGravarValor(eSessao, "SSL".ToUTF8(), Convert.ToInt32(ckbSSL.Checked).ToString().ToUTF8()); ACBrMail.CheckResult(ret); ret = ACBrMail.MAIL_ConfigGravarValor(eSessao, "TLS".ToUTF8(), Convert.ToInt32(ckbTLS.Checked).ToString().ToUTF8()); ACBrMail.CheckResult(ret); ret = ACBrMail.MAIL_ConfigGravar("".ToUTF8()); ACBrMail.CheckResult(ret); MessageBox.Show("ConfiguraĆ§Ć£o salva com sucesso!", "ACBrMail - Demo", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show("Erro ao gravar dados no INI: " + ex.Message.ToString(), "ACBrMail - Demo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }