Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I have folder in my solution called "books". In this folder I have added some txt files, for example: UserManual.txt. Now I want to use this file, but i don't know how to navigate to it. In debug mode all files are in proper folder bin\debug\books.
Please help.
Posted
Comments
Kenneth Haugland 3-Apr-13 5:28am    
Just add the text file in VS explorer, and you could just call them by ReadAllLines("MyTextFile")
szataniel 3-Apr-13 5:30am    
ok, but can i navigate to folder books?

1 solution

if you do something like :-

C#
System.Windows.Forms.Application.ExecutablePath.ToString()


iirc, you get the full path/name of the exe - in your case if the program was 'program.exe' that should be

...\bin\debug\program.exe

so if you strip off the 'program.exe', and combine whats left with 'books' that would be the correct folder

(where ... may represent C:\path\)

'g'
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900