Beispiel #1
0
        public static void testFile()
        {
            if (Directory.Exists(ClsConstantes.Table.InitialDirectory) == true)
            {
            }

            else
            {
                Directory.CreateDirectory(ClsConstantes.Table.InitialDirectory);
            }

            if (File.Exists(ClsConstantes.Table.serveur) == true && File.Exists(ClsConstantes.Table.database) == true && File.Exists(ClsConstantes.Table.user) == true && File.Exists(ClsConstantes.Table.password) == true)
            {
                ClsConnexion.GetInstance().connecter();
            }
            else
            {
                Configuration_Form frm = new Configuration_Form();
                frm.ShowDialog();
                ClsConnexion.GetInstance().connecter();
            }
        }
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         if (comboBox2.Text != "" && textBox1.Text != "" && textBox2.Text != "" && textBox3.Text != "")
         {
             File.WriteAllText(ClsConstantes.Table.serveur, comboBox2.Text.ToString());
             File.WriteAllText(ClsConstantes.Table.database, textBox1.Text.ToString());
             File.WriteAllText(ClsConstantes.Table.user, textBox2.Text.ToString());
             File.WriteAllText(ClsConstantes.Table.password, textBox3.Text.ToString());
             ClsGetdatas.GetInstance().Testeconne = 1;
             this.Close();
             ClsConnexion.GetInstance().connecter();
         }
         else
         {
             MessageBox.Show("Completez tous les champ !!!", "Saisie Obligatoire", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }