title: Reading File From Network Location
body: <p>I am having Bunch of Files in A folder which is shared on Network Drive . I am trying to Access those Files into my Code . But It is giving an error:</p>
  
  <blockquote>
    <p>System.IO.DirectoryNotFoundException was unhandled by user code</p>
  </blockquote>
  
  <pre><code>Fname = txtwbs.Text;
  DirectoryInfo objDir = new DirectoryInfo("Y:\\");
  _xmlpath = objDir + "\\" + Fname + "\\" + Fname + ".xml";
  if (File.Exists(_xmlpath ))
  {
      reader(_xmlpath);
  }
  </code></pre>
  
  <p>I have Also used:</p>
  
  <pre><code>file = fopen("\\\\10.0.2.20\\smartjobs\\Eto\\"+Fname);   
  </code></pre>
  
  <p>I am Able to Read File from My Local PC But it is giving Exception Only for Network Location .Please let me know how can I read File From Network Shared Location .</p>
  
  <p>And Also How Can I Make A tree view of Folders into Asp.net Web Application . </p>
  
  <p>Directory Structure is Like that </p>
  
  <pre><code>\\10.0.2.20\Smartjobs\Eto\
  </code></pre>
  
  <p>this is Parent Directory It is congaing Nos of Folder having XML Documents.</p>