//获取.exe文件路径 string currentPath = Application.StartupPath;
//获取该文件的上级路径 Directory.SetCurrentDirectory(Directory.GetParent(Directory.GetCurrentDirectory()).FullName); string parentPath=Directory.GetCurrentDirectory();
//如果需要继续上级路径,继续执行,就可以得到两次的上级路径 Directory.SetCurrentDirectory(Directory.GetParent(Directory.GetCurrentDirectory()).FullName);