Sub ecrire_dans_fichier_txt(ByVal nomFichier As String) try Dim ma_variable As StreamWriter = new StreamWriter(nomFichier) ma_variable.writeLine("le texte présent est ecrit dans le fichier en ligne 1") ma_variable.writeLine("ce texte aussi est ecrit dans le fichier en ligne 2") ... ma_variable.close() catch ex As Exception MessageBox.show(ex.Message) end try end sub
sub lire_dans_fichier_txt(ByVal nomFichier) try Dim ma_variable As StreamReader = new StreamReader(nomFichier) Dim ligne As String do ligne = ma_variable.readLine() MessageBox.show(ligne) MessageBox.show("") loop until ligne Is Nothing ma_variable.close() catch ex As Exception MessageBox.show(ex.Message) end try end sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question