Method TryGetExactPath
TryGetExactPath(string, out string?)
Gets the exact case used on the file system for an existing file or directory.
public static bool TryGetExactPath(string path, out string? exactPath)
Parameters
path
stringA relative or absolute path.
exactPath
stringThe full path using the correct case if the path exists. Otherwise, null.
Returns
- bool
True if the exact path was found. False otherwise.
Remarks
This supports drive-lettered paths and UNC paths, but a UNC root will be returned in title case (e.g., \Server\Share).