I am trying to create a file on the mapped drive but it is giving me an error :
Could not find a part of the path 'Y:\\score\\' where 'Y' is the mapped drive. There is a folder score in y drive and it has read and write permissions too.
Here is my code:
string filePath = "Y:\\score\\";
string[] lines = { "First line", "Second line", "Third line" };
using (StreamWriter outputFile = new StreamWriter(@filePath))
{
foreach (string line in lines)
outputFile.WriteLine(line);
}
Error comes when I am passing the filepath in the streamwriter. I am able to do this on my local drive but not on the mapped drive. I am not getting why this error is coming up. Please help me out.
Thanks