如何获取用户在Vb.Net中打开的文件的目录

时间:2019-06-23 11:48:02

标签: vb.net directory path streamreader

用户在中打开文件

Private Sub openFile_Click(sender As Object, e As EventArgs) Handles openFile.Click
    OpenFileDialog.ShowDialog()
    Dim strFileName = OpenFileDialog.FileName
    Dim objReader As New System.IO.StreamReader(strFileName)

    Do While objReader.Peek() <> -1
        <Do things>
    Loop

    objReader.Close()

End Sub

如何获取用户打开的文件的目录/路径?

0 个答案:

没有答案