Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionOption Explicit On Public Class Form1 Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load If System.IO.File.Exists(My.Application.Info.DirectoryPath & "\monFic.txt") = False Then Dim p As New System.IO.StreamWriter(My.Application.Info.DirectoryPath & "\monFic.txt") p.Close() ' création si inexistant End If End Sub Sub FICHIER_ecrit_ajoute() ' écrit première fois ou ajoute Dim p As New System.IO.StreamWriter(My.Application.Info.DirectoryPath & "\monFic.txt", True) p.WriteLine(TextBox1.Text) p.Close() End Sub End Class
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Dim p As New System.IO.StreamWriter("C:\commentaires.txt", True) p.WriteLine(TextBox3.Text) p.Close() End Sub