H
HardySpicer
I read a file from
File.ReadAllLines(App_Path() & "\file_name.txt"))
Public Function App_Path() As String
Return System.AppDomain.CurrentDomain.BaseDirectory()
End Function
and it works fine when the file is in the bin directory and I run in
debug mode also when I build - it runs fine in the same directory..
However, if I build the project
it cannot find the file (the built program is at c:\program files
\myprog\myprog.exe lets say). How can I make a path such that no
matter where the user installs the program, the file path is valid. I
could put everything in say c:\myfiles I suppose but I want all data
files to be in the install directory.
Hardy
File.ReadAllLines(App_Path() & "\file_name.txt"))
Public Function App_Path() As String
Return System.AppDomain.CurrentDomain.BaseDirectory()
End Function
and it works fine when the file is in the bin directory and I run in
debug mode also when I build - it runs fine in the same directory..
However, if I build the project
it cannot find the file (the built program is at c:\program files
\myprog\myprog.exe lets say). How can I make a path such that no
matter where the user installs the program, the file path is valid. I
could put everything in say c:\myfiles I suppose but I want all data
files to be in the install directory.
Hardy