Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

App.Path equivalent in VB .Net 2

Status
Not open for further replies.

jmerencilla

Programmer
Jul 17, 2002
123
SG
hi. i just want to know the equivalent code App.Path in VB.Net. I tried System.Reflection.Assembly.GetExecutingAssembly.Location. it gives me the path where my .exe file(eg. c:\test\test.exe)is located, but I need to know only the path without the name of my .exe (e.g c:\test). Please help. thanks. :)
 
Close. I back-up to the parent directory assuming my assembly is in a BIN directory under the APP path.
Dim strProgPath As String = (New System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly.Location)).DirectoryName")
Dim strFilePath As String = (System.IO.Directory.GetParent(strProgPath).FullName)") Forms/Controls Resizing/Tabbing Control
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
I left in a ") there.
Dim strProgPath As String = (New System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly.Location)).DirectoryName
Dim strFilePath As String = (System.IO.Directory.GetParent(strProgPath).FullName) Forms/Controls Resizing/Tabbing Control
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Hello there,
you could also do Application.StartupPath() To get the path for the executable file that start the application.

Don't Forget K.I.S.S.
"The Camel will walk the desert of programming once again ..."

Camel
 
yup good ol K.I.S.S.
Keep It Simple Stupid That'l do donkey, that'l do
[bravo] Mark
 
My moto exactlly.

Simple means less chances for bugs.
Less chances for bugs less time for debugging.
Less time for debugging.... more time at the pub !!!

"The Camel will walk the desert of programming once again ..."

Camel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top