title: Directory.GetFiles searchOption overload not working
body: <p>Just for starters, be aware that I am new to C#, StackOverflow, and programming in general. I'm having trouble with the <code>Directory.GetFiles</code> method in <code>System.IO</code>. I have all of my code working except for the <code>searchOption</code> overload. Here's my current code.</p>
  <pre><code>string[] files = Directory.GetFiles(path:&quot;C:/example&quot;, searchPattern:&quot;*.txt&quot;);
  
  foreach(string name in files) { Console.WriteLine(name); }
  </code></pre>
  <p>I'm having trouble because I want the snippet to search the directory 'example' and all of its subdirectories. I've read <a href="https://msdn.microsoft.com/en-us/library/ms143316%28v=vs.110%29.aspx" rel="nofollow noreferrer">here</a> that it's supposed to look something like <code>SearchOption.AllDirectories</code>, but when I try that in Visual Studio (Professional 2015), IntelliSense pulls up something that looks more like <code>searchOption:</code>, and I can't figure out how to put the <code>AllDirectories</code> argument into this overload. Anything I do results in one of the following errors.</p>
  <blockquote>
  <p>What I've tried (the above code with one of these as the third overload):</p>
  <p>System.IO.SearchOption.AllDirectories - Named Argument Specifications must appear after all fixed arguments have been specified.</p>
  <p>searchOption:AllDirectories - The name 'AllDirectories' does not exist in the current context.</p>
  <p>searchOption:&quot;AllDirectories&quot; - cannot convert from 'string' to 'System.IO.SearchOption'.</p>
  </blockquote>
  <p>And so forth. I've done at least 3 hours of research on the subject on MSDN, Google, StackOverflow, codeproject, and others, and I still can't find the answer.</p>