To get the directory where the .exe file is:
AppDomain.CurrentDomain.BaseDirectory
To get the current directory:
Environment.CurrentDirectory
More Related Contents:
- Can’t specify the ‘async’ modifier on the ‘Main’ method of a console app
- How can I get the application’s path in a .NET console application?
- How to write Unicode characters to the console?
- Why is the console window closing immediately once displayed my output?
- How to cancel Task await after a timeout period
- .NET Global exception handler in console application
- Why does closing a console that was started with AllocConsole cause my whole application to exit? Can I change this behavior?
- How can I write fast colored output to Console?
- Is there a way to make a console application run using only a single file in .NET Core?
- How to navigate a few folders up?
- Console.Read() and Console.ReadLine() problems [duplicate]
- How do I get a return value from Task.WaitAll() in a console app?
- When should one use Environment.Exit to terminate a console application?
- How do I compile my App.config into my exe in a VS2010 C# console app?
- how to handle spaces in file path if the folder contains the space?
- CPU friendly infinite loop
- Sending email through Gmail SMTP server with C#
- How to flatten tree via LINQ?
- Why does the order of alternatives matter in regex?
- When should I use Lazy?
- Does .NET FtpWebRequest Support both Implicit (FTPS) and explicit (FTPES)?
- Base32 Decoding
- How to make make a .NET COM object apartment-threaded?
- What is the difference between int, Int16, Int32 and Int64?
- Encoding parameters for a URL
- Dynamically implementing an interface in .NET 4.0 (C#)
- How to inject CSS in WebBrowser control?
- Releasing temporary COM objects
- Workflow Design Dilemma – State Machine, yes or no
- Decompressing password-protected ZIP files with .NET 4.5