#include "Associer_dbc1.h" ... private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { ifstream in( chemin,ios::in); int nbLignes; std::string ligne; //Création d'une chaine de caractere nbLignes = 0; //Initialisation de la variable à 0 if (! in) //Si fichier inexsistant faire.... { textBox3->Text = ("Erreur d'ouverture du fichier"); } else { while(std::getline(in, ligne)) //On lit chaque ligne du fichier que l'on stoke dans "ligne" nbLignes++; in.close(); //On ferme le fichier } textBox3->Text = nbLignes.ToString(); //textBox4->Text = nom; } ...
... public: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { openFileDialog1->ShowDialog(); System::String^ chemin = Path::GetFullPath(openFileDialog1->FileName); System::String^ nom = Path::GetFileNameWithoutExtension( openFileDialog1->FileName ); System::String^ extension = Path::GetExtension(openFileDialog1->FileName); textBox5->Text = nom; textBox6->Text = chemin; textBox1->Text = extension; } ...