void SaveData_EmailSettings() { ds.Tables[0].Clear(); if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Personal) + System.IO.Path.DirectorySeparatorChar + "SignCabProfilesettings.xml")) { File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.Personal) + System.IO.Path.DirectorySeparatorChar + "SignCabProfilesettings.xml"); } HelpMeDatabaseConfiguration.Configurations.DatabaseSecurity obj = new HelpMeDatabaseConfiguration.Configurations.DatabaseSecurity(); DataRow dr = ds.Tables[0].NewRow(); dr["Id"] = txtLoginId.Text; dr["pass"] = obj.EncryptString(txtEmailPassword.Text); dr["port"] = txtPortNo.Text; dr["server"] = txtSMTPServer.Text; dr["sender"] = txtSender.Text; dr["receiver"] = txtReceiver.Text; dr["ssl"] = chkSSL.Checked; dr["async"] = chkAsync.Checked; dr["isvalid"] = IsValidEmailSetting; ds.Tables[0].Rows.Add(dr); ds.Tables[0].AcceptChanges(); ds.WriteXml(Environment.GetFolderPath(Environment.SpecialFolder.Personal) + System.IO.Path.DirectorySeparatorChar + "SignCabProfilesettings.xml"); }
private void frmMain_Load(object sender, EventArgs e) { #region Database Settings ApplicationHelper.DatabaseHelper.HelpMeConnectionString = string.Empty; HelpMeDatabaseConfiguration.Configurations.DatabaseSecurity dbSecurity = null; string FilePath = Application.StartupPath + System.IO.Path.DirectorySeparatorChar + "DBConfig.HelpMe"; if (File.Exists(FilePath)) { dbSecurity = new HelpMeDatabaseConfiguration.Configurations.DatabaseSecurity(); ApplicationHelper.DatabaseHelper.HelpMeConnectionString = dbSecurity.DecryptFiletoString(); ApplicationHelper.DatabaseHelper.HelpMeDatabaseProvider = dbSecurity.ProviderName; BeanHelper.DBHelper.ConnectionString = ApplicationHelper.DatabaseHelper.HelpMeConnectionString; BeanHelper.DBHelper.ProviderName = ApplicationHelper.DatabaseHelper.HelpMeDatabaseProvider; } #endregion Android_ApplicationId = "AAAA1P9IXqo:APA91bESNkpeKW4y6PB0bbsUXOibHOPGyGEfEDZTblvu0LdkcDokcM-MZaPX5DtnTOGU8ogVh-dgkNYpjKA2jDhDy04U9rLHajBvJDL7oWoPqAIAz5_s4fTJoakxnSmtlXgx2_GXOzfB"; Android_SenderId = "914815999658"; IOS_Port = 2195; IOS_Hostname = "gateway.push.apple.com"; IOS_CertificatePath = Application.StartupPath + "\\IOSCertificate\\iphone_pro.p12"; IOS_Password = "******"; //string TokenId = "fwBflGr6fBc:APA91bFNfRqq1MqCYjM3BNViRkPwLleqjjWjp9Cn3BQcBRhfEfzMcylPvWOWnKE83NM0cmPm9Ma8D9VrOBPTf6uwn988euyGYLm_Jr297WE7n-3XdrcR_-l50hCFXPIaMzpadVZG9Gy4"; //SendAndroidNotification(TokenId, "HelpMe", "Hello HelpMe ! Message"); //SendAndroidNotification(TokenId, "HelpMe", "Hello HelpMe ! Message"); Scheduled_Execution(); }
void LoadData() { HelpMeDatabaseConfiguration.Configurations.DatabaseSecurity obj = new HelpMeDatabaseConfiguration.Configurations.DatabaseSecurity(); txtLoginId.Text = ds.Tables[0].Rows[0]["Id"].ToString(); txtEmailPassword.Text = obj.DecryptString(ds.Tables[0].Rows[0]["pass"].ToString()); txtPortNo.Text = ds.Tables[0].Rows[0]["port"].ToString(); txtSMTPServer.Text = ds.Tables[0].Rows[0]["server"].ToString(); txtSender.Text = ds.Tables[0].Rows[0]["sender"].ToString(); txtReceiver.Text = ds.Tables[0].Rows[0]["receiver"].ToString(); chkSSL.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["ssl"]); chkAsync.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["async"]); if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["isvalid"].ToString())) { IsValidEmailSetting = Convert.ToBoolean(ds.Tables[0].Rows[0]["isvalid"]); } }
void frmSettings_Load(object sender, System.EventArgs e) { #region Database Settings string FilePath = Application.StartupPath + System.IO.Path.DirectorySeparatorChar + "DBConfig.HelpMe"; HelpMeDatabaseConfiguration.Configurations.DatabaseSecurity dbSecurity = null; if (File.Exists(FilePath)) { dbSecurity = new HelpMeDatabaseConfiguration.Configurations.DatabaseSecurity(); dbSecurity.DecryptFiletoString(); txtServer.Text = dbSecurity.ServerName; ddlAuthentication.Text = dbSecurity.Authentication + " " + "Authentication"; txtUserId.Text = dbSecurity.UserName; txtPassword.Text = dbSecurity.Password; ddlDatabase_Enter(null, null); ddlDatabase.Text = dbSecurity.DatabaseName; } #endregion }
private void btnSave_Click(object sender, EventArgs e) { #region Variables this.btnSave.Enabled = false; string strConnTest = string.Empty; bool isAuthenticated; #endregion #region Database Settings string FilePath = string.Empty; FilePath = Application.StartupPath + System.IO.Path.DirectorySeparatorChar + "DBConfig.HelpMe"; if (File.Exists(FilePath)) { File.Delete(FilePath); } #region Local DB isAuthenticated = false; if (!string.IsNullOrEmpty(ddlDatabase.Text)) { if (ddlAuthentication.Text == "Windows Authentication") { strConnTest = "Server=" + txtServer.Text + ";Database=" + ddlDatabase.Text + ";integrated security=true;"; } else { strConnTest = "Server=" + txtServer.Text + ";Database=" + ddlDatabase.Text + ";UID=" + txtUserId.Text.Trim() + ";Password="******";"; } try { SqlConnection cnTemp = new SqlConnection(strConnTest); cnTemp.Open(); cnTemp.Close(); isAuthenticated = true; } catch { } } if (!isAuthenticated) { lblMessageBar.Text = "Quick Doc Database Settings are not Authenticated. Please verify the database information provided."; return; } #endregion string strConn_local = string.Empty; if (ddlAuthentication.Text == "Windows Authentication") { strConn_local = "Authentication:windows#Server:" + txtServer.Text + "#Database:" + ddlDatabase.Text; } else { strConn_local = "Authentication:server#Server:" + txtServer.Text + "#Database:" + ddlDatabase.Text + "#UserID:" + txtUserId.Text + "#Password:"******"~Provider:System.Data.SqlClient"; HelpMeDatabaseConfiguration.Configurations.DatabaseSecurity dbs = new HelpMeDatabaseConfiguration.Configurations.DatabaseSecurity(); FilePath = Application.StartupPath + System.IO.Path.DirectorySeparatorChar + "DBConfig.HelpMe"; dbs.EncryptStringtoFile(strConn, FilePath); lblMessageBar.Text = "Quick Doc Database Settings Saved Successfully."; SetScheduler(); this.btnSave.Enabled = true; #endregion }