title: How to search all directories in all drives for .txt files?
body: <p>I am using this code to search all directories in all drives to search for all .txt files:</p>
  
  <pre><code>public List&lt;string&gt; Search()
  {
      var files = new List&lt;string&gt;();
      foreach (DriveInfo d in DriveInfo.GetDrives().Where(x =&gt; x.IsReady == true))
      {
          files.AddRange(Directory.GetFiles(d.RootDirectory.FullName, "*.txt", SearchOption.AllDirectories));
       }
       return files;
  }
  </code></pre>
  
  <p>but in running I am having this error:
  <img src="https://i.stack.imgur.com/yc33f.png" alt="enter image description here"></p>
  
  <p>How to resolv it?</p>
  
  <p>Thank you.</p>