// exepath2.cs using System; using System.Windows.Forms; class ExePath2 { public static void Main() { string path = Application.ExecutablePath; Console.WriteLine(path); // 出力例:c:\c#\tips\016exepath\exepath2.exe } } // コンパイル方法:csc exepath2.cs