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); }
转载于:https://www.cnblogs.com/fengmingming/p/6834818.html