See if this helps.
Public Class Form1
Private myFile As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\New.txt"
Private arFileContent() As String = Nothing
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If File.Exists(myFile) Then
arFileContent = File.ReadAllLines(myFile) '// load file lines into Array.
Kill(myFile) '// delete file.
MsgBox(arFileContent(0)) '// FOR TESTING, READ LINE 1.
End If
End Sub
End Class
codeorder
Postaholic
2,124 posts since Aug 2010
Reputation Points: 256
Solved Threads: 387
Skill Endorsements: 8