|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Console app & Base pathHi,
I have a console app. I have to search for files in the directory from which my application is run. Here's an example : c:\MyApp>MyApp.exe param1 param2 The base path is C:\MyApp... but if I do the following : c:\MyApp\SubDir>..\MyApp.exe param1 param2 The base path should be C:\MyApp\Subdir... Is there a way to get this value? I tried AppDomain.CurrentDomain.BaseDirectory, but it always returns c:\MyApp... Please help... ;) ThunderMusic I found it in the Environment properties.
Thanks Show quote "ThunderMusic" <NoSpAmdanlatathotmaildotcom@NoSpAm.com> wrote in message news:%23yXLEy$MHHA.3952@TK2MSFTNGP02.phx.gbl... > Hi, > I have a console app. I have to search for files in the directory from > which my application is run. Here's an example : > > c:\MyApp>MyApp.exe param1 param2 > > The base path is C:\MyApp... but if I do the following : > > c:\MyApp\SubDir>..\MyApp.exe param1 param2 > > The base path should be C:\MyApp\Subdir... Is there a way to get this > value? I tried AppDomain.CurrentDomain.BaseDirectory, but it always > returns c:\MyApp... > > Please help... ;) > > ThunderMusic > > Use the Application's StartUpPath property
Show quote "ThunderMusic" wrote: > Hi, > I have a console app. I have to search for files in the directory from which > my application is run. Here's an example : > > c:\MyApp>MyApp.exe param1 param2 > > The base path is C:\MyApp... but if I do the following : > > c:\MyApp\SubDir>..\MyApp.exe param1 param2 > > The base path should be C:\MyApp\Subdir... Is there a way to get this > value? I tried AppDomain.CurrentDomain.BaseDirectory, but it always returns > c:\MyApp... > > Please help... ;) > > ThunderMusic > > > |
|||||||||||||||||||||||