there was App.path in vb6 to indicate the application folder..how to do this in vb.net???
Printable View
there was App.path in vb6 to indicate the application folder..how to do this in vb.net???
System.Reflection.Assembly.GetExecutingAssembly.Location --> This will give you the whole path including the exe name..Quote:
Originally Posted by shuvo
There is no App object present in .NET so you will have to look through MSDN to find out wat are the different equivalents of App object...
Application.StartupPath
This gives the path of Application Executable excluding the exe file name.
Hope this helps.
U can get the name of the executable file by your defined code..but it is not useful when u want to open a file like a Dat file or Txt file then u will need the specific address string like we used to get App.path\text.txt.How do I get that?
Application.StartupPath & "\text.txt".
This will give you the file from the apllication folder i.e. BIN folder.
See EXCLUDING in last reply
yes Amit...I didn't see ur Reply before my last reply...ur solution solved my problem..thanx a lot.
When constructing PATH, use System.IO.Path.Combine() method.