c# get executable path

C#
//This path contains the .exe file
System.Reflection.Assembly.GetEntryAssembly().Location;


Source

Also in C#: