In manual mode, I have a network drive connected Y: // Into my system .Drive has Manny Folders files, each of which contains a separate XMl file that has the same folder as the folder.
Here I am trying to read an Xml file from a network location. But this exception The directory was not found . Below is the code I use for this.
Fname = txtwbs.Text; DirectoryInfo objDir = new DirectoryInfo("Y:\\"); \\Y:\\ protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { _xmlpath = objDir + "\\" + Fname + "\\" + Fname + ".xml"; if (File.Exists(_xmlpath )) { reader(_xmlpath); } }
Here, Fname is the name of the folder and the name of the Xml. Any user enters a file name.
source share