title: C# printing path of folders and files to console
body: <p>So I've been working on a new programm right now and I'm stuck at one function and I don't know how to solve this problem. </p>
  
  <p>So I'm trying to make a button which searches and prints paths of files and folders which have a specific name. After I tried some functions and they all failed, I found this and it should work but it just doesn't print anything.</p>
  
  <pre><code>string[] files = Directory.GetFiles(@"C:\Program Files", "NameOfFileOrFolder",
              SearchOption.AllDirectories);
          foreach (var file in files)
          {
              Console.WriteLine(file);
          }
  </code></pre>
  
  <p>Btw. the console does not even open itself...</p>