DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: C# Application Directory

  1. #1
    Join Date
    May 2006
    Posts
    40

    C# Application Directory

    I need to find the directory that my .exe file is executing from.

    The only problem I've got is it's a console application so doesn't use windows.forms, how do I go about doing this?

    Thanks
    J JJ

  2. #2
    Join Date
    May 2006
    Posts
    40
    Ok I've solved this.

    For those that are wondering:

    AppDomain.CurrentDomain.BaseDirectory

    This returns the directory the .exe is in
    J JJ

  3. #3
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    You can also set a reference to the System.Windows.Forms namespace (yes, even in a console app) and use any of these techniques: http://www.google.com/search?q=c%23+app+path
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Application act as another user
    By sremiger in forum .NET
    Replies: 3
    Last Post: 04-01-2005, 04:12 PM
  2. Replies: 1
    Last Post: 02-23-2005, 10:06 AM
  3. Inventory Management Application Using VB
    By Krishna in forum vb.announcements
    Replies: 0
    Last Post: 11-26-2002, 12:03 AM
  4. Application Directory
    By Navin in forum .NET
    Replies: 3
    Last Post: 07-29-2002, 01:27 PM
  5. Recursive Directory Search ?
    By Bob in forum .NET
    Replies: 1
    Last Post: 12-14-2001, 03:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center