private static string EnsureTrailingSlash(string path) { if (!path.EndsWith("\\", StringComparison.Ordinal)) { path += "\\"; } return path; } }