Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.IO
- Public Class Form1
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim w As IO.StreamWriter
- w = My.Computer.FileSystem.OpenTextFileWriter("E:\WillTest.txt", True)
- w.WriteLine("Nandhu")
- w.WriteLine("True")
- w.Close()
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- Dim r As IO.StreamReader
- r = My.Computer.FileSystem.OpenTextFileReader("E:\WillTest.txt")
- Dim s As String
- ' new code to loop thought the lines of text in your file.....
- Do While r.Peek() >= 0
- s = r.ReadLine()
- If s = "True" Then
- MessageBox.Show("Success", "Success")
- End If
- Loop
- r.Close()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement