How to Get the Path of the Current Executable Program in C#? Options

codeling 1298 - 5544
@2015-12-16 14:35:58

You can use Application.ExecutablePath Property to get the path for the executable file that started the application, including the executable name.

string path = System.Windows.Forms.Application.ExecutablePath;
 

codeling 1298 - 5544
@2015-12-16 14:36:54

How to get the same for console application?

using System.Reflection;

string path = Assembly.GetExecutingAssembly().Location;
Users browsing this topic
Guest