try this
Code:
Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim ofd As New OpenFileDialog()
Dim MyValue As String = ""
ofd.InitialDirectory = "c:\"
ofd.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"
If ofd.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
Using sr As New StreamReader(ofd.FileName)
MyValue = sr.ReadToEnd()
End Using
End If
End Sub
That should work, and if the file is not found
use ofd.CheckFilePath, or a property with a similar name which checks the file exists...