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 33 34 35 36 37
|
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim FILE_NAME As String = "C:\Users\***\Desktop\lol.txt"
Dim i As Integer
Dim aryText(4) As String
aryText(0) = "test"
aryText(1) = "test2"
aryText(2) = "test3"
aryText(3) = "test4"
aryText(4) = "test5"
Dim objWriter As New System.IO.StreamWriter(FILE_NAME, True)
For i = 0 To 4
objWriter.WriteLine(aryText(i))
Next
objWriter.Close()
MsgBox("Texte ajouté et/ou corrigé")
If Not Text.Contains("test") Then
MsgBox("d")
End If
End Sub
End Class |
Partager