I'm trying to read a *.txt file and see if it has anything written on it. This is my code:
But when i use it doesn't pop the MsgBox. What's wrong with it?Code:Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim line As String = Nothing Dim reader As New IO.StreamReader("C:\text.txt") line = reader.ReadLine() If line = Nothing Then MsgBox("There are no text!", MsgBoxStyle.Exclamation, "Error") End If End Sub





Reply With Quote