retrieve console application path

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
What is the easiest way to retrieve the path from a console application?

Right now I am using:
- System.Reflection.Assembly.GetEntryAssembly().Location to extract the path
and filename
- path.getfullpath to split path and filename

I am almost sure there is an easier way...!?

Jan
 
Jan,

How much easier do you want it? It's two lines.

You could use the static CurrentDirectory property on the Environment
class, but you have to be careful, as it doesn't guarantee that the return
value will be the path that your console app is in.

Hope this helps.
 
Back
Top