title: System.IO.DirectoryNotFoundException: 'Could not find a part of the path
body: <p>I'm trying to implement a method that return files from a folder of my computer, but, this error showed for me:</p>
  <blockquote>
  <p>System.IO.DirectoryNotFoundException: Could not find a part of the path.</p>
  </blockquote>
  <p>This is my code:</p>
  <pre><code>public List&lt;string&gt; GetFileName()
      {
          List&lt;string&gt; arquivos = new List&lt;string&gt;();
          DirectoryInfo d = new DirectoryInfo(&quot;C:\\Files&quot;);
          FileInfo[] Files = d.GetFiles();
          foreach (FileInfo file in Files)
          {
              arquivos.Add(file.Name);
          }
          return arquivos;
      }
  </code></pre>
  <p>I would like know if in .NET MAUI or Xamarin Forms this process for take a path external is different. Thank you since now!</p>