2011-04-26 45 views

回答

11

这将完整的路径返回到应用程序

System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) 
1

添加引用System.Windows.Forms,并添加使用部分

using System.Windows.Forms; 
0

一般来说,Application.StartupPath()会给路径应用程序。而且你也缺少这个名字空间。 System.Windows.Forms

0

System.Windows.Forms.Application.StartupPath必须返回正在运行的可执行文件的路径。

5

你能做到这样也

  System.AppDomain.CurrentDomain.BaseDirectory 
相关问题