1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| private FrmIndex Frm;
public FrmBD(FrmIndex F)
{
//
// Requis pour la prise en charge du Concepteur Windows Forms
//
InitializeComponent();
Frm = F;
//
// TODO : ajoutez le code du constructeur après l'appel à InitializeComponent
//
}
void Enregistrer(bool exit)
{
string Chemin = TxtChemin.Text;
if(Chemin == "")
MessageBox.Show("Vide");
else
{
FileStream monfic = new FileStream(System.Windows.Forms.Application.StartupPath + "\\Source.txt",FileMode.Create,FileAccess.Write);
StreamWriter Ecrire = new StreamWriter(monfic);
Ecrire.WriteLine(TxtChemin.Text);
Ecrire.Close();
monfic.Close();
Frm.BD();
if(exit == true)
this.Close();
else
BtnAppliquer.Enabled = false;
}
} |