Visual Basic file path to stream

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pinkahchu
    New Member
    • Jan 2017
    • 1

    Visual Basic file path to stream

    I'm attempting to read data from a file via a StreamReader. I need the file path to be dynamic and change according to the users storage location. I'm able to retrieve the file path, however, my StreamReader cannot read the file. Is this something relating to File read permissions or is it because the file path has space in it?

    I will present the code currently being run to determine the file path. This is not entirely my code, i'm just in the process of testing this to see if I can figure it out.

  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    It would help if you posted the exception that you are getting.

    You could use the File.Exists Method to check if the file is actually at the location provided before trying to read the file...user's sometimes input things incorrectly.

    -Frinny

    Comment

    Working...