How to get the current executable's path in C# (Code sample)
Sometimes you may want to get the current executable file path of your C# program. The working folder is needed to access settings, database, images, or resource files residing in the same directory as the currently running C# executable file of your program.
There are several options to find the current executable path in C#. But we have found the one that is working both for C# .NET Console Applications and for C# Windows Forms Applications: