Converting a Short Path Name to a Long Path Name and vice versa
Recently the BCL team posted:
Give me the Short Path/File/Directory names, baby! [Kit George]
Keith Hill inquired recently:
There are times when displaying long paths (like as a menu item) that you would like to display a shortened path. Since the Win32 API already has a CompactPath API, it would be nice to expose this via the Path class.
We completely agree Keith, this is something we haven't had a chance to get to, but it is on our radar. It won't be available in Whidbey, but keep an eye out for it in the future.
If you want this now, I wrote a GotDotNet sample that adds static methods to convert back and forth between Long and Short path names.
Comments
- Anonymous
March 23, 2004
This is not what Keith is after. He's talking about converting a path such as:
"C:Document and SettingsuserMy DocumentsFolderFile.doc"
to
"C:Document and Settings......FolderFile.doc - Anonymous
March 23, 2004
ooooh, I see. Sorry bout that.