Open a txt file when a button clicked in VB.NET
Dim FILE_NAME As String = "C:\FileName.txt"
If System.IO.File.Exists(FILE_NAME) = True Then
Process.Start(FILE_NAME)
Else
MsgBox("File Does Not Exist")
End If
Here is a simple example:
Public Class OpenTextFile
Private Sub OpenTextFile_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub OpenBUT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenBUT.Click
'OpenBUT_Click the text file
Process.Start("C:\File Name.txt")
End Sub
End Class