然后:Application类的
public static string StartupPath {get;}
获取启动了应用程序的可执行文件的路径。
下面的示例获取该属性并在文本框中显示其值。示例假定 textBox1 已放置在窗体上。
[C#]
private void PrintStartupPath() {
textBox1.Text = "The path for the executable file that " +
"started the application is: " +
Application.StartupPath;
}