In Delphi there is a function ExpandUNCFileName that takes in a filename and converts it into the UNC equivalent. It expands mapped drives and skips local and already expanded locations.
Samples
C:FolderText.txt -> C:FolderText.txt
L:FolderSample.txt -> \serverFolder1FolderSample.txt Where L: is mapped to \serverFolder1
\serverFolderSample.odf -> serverFolderSample.odf
Is there a simple way to do this in C# or will I have to use windows api call WNetGetConnection and then manually check the ones that wouldn't get mapped?
See Question&Answers more detail:os