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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top