Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB8.0
The application I'm developing populates list boxes by reading a text file at the form load event. At the moment I have the file located in C:\ and that's the path in my program.
When I build the project I would like the text file to be in the same folder as the app (or a sub folder), so how do I make the path relative?
 
ie FileReader = New StreamReader(Relative Path)
 
Paul
Posted 5-May-10 14:22pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You don't. You look up the startup path, it's a property of the Application object.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Thanks very much. Worked like a charm.
It's so easy when you know how !!
Still learning.
  Permalink  
Comments
Christian Graus at 5-May-10 20:19pm
   
No problems. You should use the Add Comment link to add comments, rather than push answer when what you're posting is not an answer. But, I do appreciate you thanking me, not many people do. You should also mark my comment as being the correct answer, so that the search system can optimise to use the data we've provided. If you feel inclined, you can also vote my answer a 5, but that's up to you. Either way, you're welcome :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 5 May 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100