private void btnTest_Click(object sender, EventArgs e) { verifyDB = new clsEmailVerifier(); string sret = string.Empty; sret = verifyDB.DbConnectSourceDB("Server=mssql2012;Database=EmailVerifier;User Id=sa;Password=lalalala;", 1); verifyDB.SetSettings(txtKeyField2.Text, "Server=mssql2012;Database=EmailVerifier;User Id=sa;Password=lalalala;", 1, txtTableName.Text, txtEmailFieldFrom.Text, txtEmailFieldTo.Text, txtReasonID.Text, txtSupressionID.Text, chkFixTyposMajorISP.Checked, chkFixKnownTyposGeneral.Checked, chkDeleteFictitiousDomains.Checked, chkDeleteSpamTrapDomains.Checked, chkDeleteSpamTrapAddresses.Checked, chkDeleteWirelessDomains.Checked, chkDeleteRoleUsernames.Checked, chkFixTypoSuffix.Checked, chkDeleteBadFormatedEmails.Checked, chkDeleteBadFormatedMajorISP.Checked, chkDeleteEmailsWithNoMXgeneral.Checked, chkDeleteEmailifMXcantVerifyMajorISP.Checked, chkDeleteEmailifMXcantVerifyGeneral.Checked, txtDns.Text); sret = verifyDB.Verify(sTestEmail.Text); MessageBox.Show(sret); }
private void frmMain_Load(object sender, EventArgs e) { frmInput frm = new frmInput(this); frm.ShowDialog(); clsEmailVerifier verifyDB2 = new clsEmailVerifier();; string sret = ""; dsUserSettings = new DataSet(); sret = verifyDB2.DbConnectSourceDB("Data Source=sql2012a;Initial Catalog=EmailVerifier;User Id=sa;Password=Yankeesmets1;", 1); try { dsUserSettings = verifyDB2.DbDataSetDB("select * from last_settings where user_name = '" + lblEmailFieldTo.Text + "'", 1); txtKeyField2.Text = dsUserSettings.Tables[0].Rows[0]["id_field"].ToString(); txtConnectionString.Text = dsUserSettings.Tables[0].Rows[0]["ConnectionString"].ToString(); iConnectionType = (byte)dsUserSettings.Tables[0].Rows[0]["iConnectionType"]; txtConnectionString.Text = txtConnectionString.Text.Replace("\\\\", "\\"); txtTableName.Text = dsUserSettings.Tables[0].Rows[0]["table_name"].ToString(); txtEmailFieldFrom.Text = dsUserSettings.Tables[0].Rows[0]["email_field_name"].ToString(); txtDns.Text = dsUserSettings.Tables[0].Rows[0]["dns_server"].ToString(); chkFixTyposMajorISP.Checked = (bool)dsUserSettings.Tables[0].Rows[0]["chkFixTyposMajorISP"]; chkFixKnownTyposGeneral.Checked = (bool)dsUserSettings.Tables[0].Rows[0]["chkFixKnownTyposGeneral"]; chkDeleteFictitiousDomains.Checked = (bool)dsUserSettings.Tables[0].Rows[0]["chkDeleteFictitiousDomains"]; chkDeleteSpamTrapDomains.Checked = (bool)dsUserSettings.Tables[0].Rows[0]["chkDeleteSpamTrapDomains"]; chkDeleteSpamTrapAddresses.Checked = (bool)dsUserSettings.Tables[0].Rows[0]["chkDeleteSpamTrapAddresses"]; chkDeleteWirelessDomains.Checked = (bool)dsUserSettings.Tables[0].Rows[0]["chkDeleteWirelessDomains"]; chkDeleteRoleUsernames.Checked = (bool)dsUserSettings.Tables[0].Rows[0]["chkDeleteRoleUsernames"]; chkFixTypoSuffix.Checked = (bool)dsUserSettings.Tables[0].Rows[0]["chkFixTypoSuffix"]; chkDeleteBadFormatedEmails.Checked = (bool)dsUserSettings.Tables[0].Rows[0]["chkDeleteBadFormatedEmails"]; chkDeleteBadFormatedMajorISP.Checked = (bool)dsUserSettings.Tables[0].Rows[0]["chkDeleteBadFormatedMajorISP"]; chkDeleteEmailsWithNoMXgeneral.Checked = (bool)dsUserSettings.Tables[0].Rows[0]["chkDeleteEmailsWithNoMXgeneral"]; chkDeleteEmailifMXcantVerifyMajorISP.Checked = (bool)dsUserSettings.Tables[0].Rows[0]["chkDeleteEmailifMXcantVerifyMajorISP"]; chkDeleteEmailifMXcantVerifyGeneral.Checked = (bool)dsUserSettings.Tables[0].Rows[0]["chkDeleteEmailifMXcantVerifyGeneral"]; } catch { } verifyDB2.DbClose(1); }