web analytics

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

Options

codeling 1595 - 6639
@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;
@2015-12-16 14:36:54

How to get the same for console application?

using System.Reflection;

string path = Assembly.GetExecutingAssembly().Location;

Comments

You must Sign In to comment on this topic.


© 2024 Digcode.com