第一种方法:

  1. DirectoryInfo di = new DirectoryInfo(string.Format(@"{0}..\..\", Application.StartupPath));
  2. di.FullName

第二种方法:

  1. DirectoryInfo info = new DirectoryInfo(Application.StartupPath);
  2. String path = info.Parent.Parent.FullName;

第三种方法:

  1. string WantedPath = Application.StartupPath.Substring(0,Application.StartupPath.LastIndexOf(@"\"));