Ejemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         if (comboBox1.Text != "" && comboBox2.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "")
         {
             File.WriteAllText(Chemin_Connexion.Table.server, comboBox2.Text.Trim());
             File.WriteAllText(Chemin_Connexion.Table.database, textBox2.Text.Trim());
             File.WriteAllText(Chemin_Connexion.Table.user, textBox3.Text.Trim());
             File.WriteAllText(Chemin_Connexion.Table.password, textBox4.Text.Trim());
             this.Close();
             Cls_Connexion.Instance().Connect();
         }
         else
         {
             MessageBox.Show("Invalid server configuration", "Error...", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }catch (Exception ex) { MessageBox.Show("Error : " + ex.Message, "Error...", MessageBoxButtons.OK, MessageBoxIcon.Error); }
 }
        public static void Test_Flies()
        {
            if (Directory.Exists(Chemin_Connexion.Table.InitialDiarictory))
            {
            }
            else
            {
                Directory.CreateDirectory(Chemin_Connexion.Table.InitialDiarictory);
            }

            if (File.Exists(Chemin_Connexion.Table.server) == true && File.Exists(Chemin_Connexion.Table.database) == true &&
                File.Exists(Chemin_Connexion.Table.user) == true && File.Exists(Chemin_Connexion.Table.password) == true)
            {
                Cls_Connexion.Instance().Connect();
            }
            else
            {
                FormConfigurationServer frmconf = new FormConfigurationServer();
                Create_User             user    = new Create_User();
                frmconf.ShowDialog();
                Cls_Connexion.Instance().Connect();
                user.ShowDialog();
            }
        }