Console Application Paths

Argh!! When programming console applications, there are times when I need to know the path that the executable resides in. When making regular windows forms applications, a property is made available with this information to get the applications path. Well, I took the liberty of using a little bit of reflection to get this information and make it easily accessible within my C# console application.

   40         static string ApplicationPath
   41         {
   42             get
   43             {
   44                 return Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
   45             }
   46         }

Leave a Reply