Cannot create directory on local network

63 views Asked by At
string serverPath = GetServerDirectory(serverDirectory);
string fullPath = @Path.Combine(serverPath, "P00125");

if (!Directory.Exists(fullPath))
    Directory.CreateDirectory(fullPath);

The fullPath should be: "\\\\192.168.100.9\\98 PatientsScan\\P00125"

But the actual value is: "\\\\192.168.100.9\\98 PatientsScan"

and the Directory.CreateDirectory(fullPath); throws the following exception:

System.IO.PathTooLongException: 'The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.'

0

There are 0 answers