lecture_d_un_fichier_texte
Lecture d'un fichier texte
- |OpenFileDialog
System.IO.StreamReader file = new System.IO.StreamReader(textBoxIdModele.Text);
string Text = file.ReadToEnd();
file.Close();
Lecture d'un fichier texte ligne par ligne
- |OpenFileDialog
List<string> lines = new List<string>();
string line;
System.IO.StreamReader file = new System.IO.StreamReader(@"c:\test.txt");
while ((line = file.ReadLine()) != null)
{
lines.Add(line);
}
lecture_d_un_fichier_texte.txt · Dernière modification: 2017/12/06 16:13 (modification externe)