G
Guest
Hi,
I am having a bit of a nightmare with the following:
if(!Directory.Exists(folderPath))
Directory.CreateDirectory(folderPath);
When I add a watch to this while debugging I see that the value of
folderPath is
@"\\MachineName\Foldername\AnotherFolderName\0\001\487"
However, this throws up a DirectoryNotFoundException with the following
message:
"Could not find a part of the path \"\\\\MachineName\\Foldername\"."
I clicked Start--> Run and entered \\MachineName\Foldername, which took me
to the directory. So why can't it be found in code? I can navigate all the
way down to \\MachineName\Foldername\AnotherFolderName\0\001 (it is the last
folder, 487, that I am trying to create). If I am able to navigate to the
folder through windows explorer, shouldn't I be able to access it in code?
This has worked previously so that adds even more to the confusion.
I assume that the \\\\ in the error message rather than just \\ is because
of the escape characters, but apart from that I cannot think what the problem
may be.
Any help would be greatly appreciated.
I am having a bit of a nightmare with the following:
if(!Directory.Exists(folderPath))
Directory.CreateDirectory(folderPath);
When I add a watch to this while debugging I see that the value of
folderPath is
@"\\MachineName\Foldername\AnotherFolderName\0\001\487"
However, this throws up a DirectoryNotFoundException with the following
message:
"Could not find a part of the path \"\\\\MachineName\\Foldername\"."
I clicked Start--> Run and entered \\MachineName\Foldername, which took me
to the directory. So why can't it be found in code? I can navigate all the
way down to \\MachineName\Foldername\AnotherFolderName\0\001 (it is the last
folder, 487, that I am trying to create). If I am able to navigate to the
folder through windows explorer, shouldn't I be able to access it in code?
This has worked previously so that adds even more to the confusion.
I assume that the \\\\ in the error message rather than just \\ is because
of the escape characters, but apart from that I cannot think what the problem
may be.
Any help would be greatly appreciated.