winform 获取项目的根目录
private static string GetApplicationPath()
{
string path = Application.StartupPath;
string folderName = String.Empty;
while (folderName.ToLower() != "bin")
{
path = path.Substring(0, path.LastIndexOf("\\"));
folderName = path.Substring(path.LastIndexOf("\\") + 1);
}
return path.Substring(0, path.LastIndexOf("\\") + 1);
}