如何使用 openfiledialog 打开文件
以下是我的代码:
Dim Fs As StreamReader
With OpenFD
.FileName = ""
.Title = "Open Text File"
.InitialDirectory = "c:\"
.Filter = "Text files|*.txt"
.ShowDialog()
End With
Dim path As String = OpenFD.FileName
txtin.Text = OpenFD.FileName
Fs = New StreamReader(path)
我可以得到文件的路径。但无法打开文件。任何人都可以帮忙。提前致谢