Q.: Create a windows application in VB.Net 2008 which To Read TextFile .
In VB.Net 2008, sometimes we have require To Read TextFile. This Example Shows How To Read TextFile .
Compability: Microsoft Visual Studio 2008 (Microsoft .Net Framework 3.5)
Source Code:
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim line As String
Dim readFile As System.IO.TextReader = New _
StreamReader("D:textfile.txt")
While True
line = readFile.ReadLine()
If line Is Nothing Then
Exit While
Else
MsgBox(line)
End If
End While
readFile.Close()
readFile = Nothing
Catch ex As IOException
MsgBox(ex.ToString)
End Try
End Sub
End Class
Output:



thanksssssssssss