Path Directory..

Signo.X

Well-known member
Joined
Aug 21, 2006
Messages
76
Location
Australia
Programming Experience
1-3
Whats the best way to specify the path of specific file and directory ..

for e.g.
VB.NET:
if file.exists("C:/temp/documents/test.txt")

the above will only work if the user has the exact same directory, but what happened when u move the application to a different pc ? and the user doesnt have the exact same directory ? maybe even a different drive name..??

whats the best way to refer to files and directories in vb.net?

Thanks in advance,
~signo.X
 
Relative. Application.StartupPath is directory app starts from.
 
isnt that the same as :
if file.exists("/temp/documents/test.txt")
without speciying the drive name ?

also, Application.StartupPath works only with win forms, not for console application??​
 
No, because that works relative to current directory which may change a lot, also by factors outside the application.
 
Back
Top