c# windows application get current path

C#
System.IO.Path.GetDirectoryName(Application.ExecutablePath);
Source

Also in C#: