UNC path not working with .NET?

I run a very simple program that tries to display files in a folder on the same computer that is specified in UNC format (as described in http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v= vs. 85% 29.aspx ):


static string rootDir = @"\\?\d:\share\input";

static void Main(string[] args)
{
    char[] invlidChars = Path.GetInvalidPathChars();
    foreach (char invChar in invlidChars)
    {
        if (rootDir.Contains(invChar.ToString()))
        {
            Console.WriteLine("InvChar - {0}", invChar);
        }
    }
    string[] matchFiles = Directory.GetFiles(rootDir);
}

Directory.GetFiles() ArgumentException ( , - , , InvalidPathChars.). Console.Writeline() , . , "\\ UNC \?\D:\share\input" "\\ UNC \?\_\share\input" "\\?\_\\".

"d:\share\input" .

- , ?

!

+5
1

, \\?\ - API Windows, .NET. \\?\ UNC-, API Windows:

/ "\\?\" Windows API, .

UNC, UNC, \\machinename\d$\share\input. . .

, .NET, , , , .

+8

All Articles