I\'m trying to write a static member function in C# or find one in the .NET Framework that will re-case a file path to what the filesystem specifies.
Example:
<
You can search for the file you want to get the case on and return the results of your search (you want to check the casing of a file that exists, right?). Something like this:
public static string GetProperFilePathCapitalization(string filepath) {
string directoryPath = Path.GetDirectoryName(filepath);
string[] files = Directory.GetFiles(directoryPath, Path.GetFileName(filepath));
return files[0];
}
Is this what you're looking for?