title: system io file not found exception/ error handling
body: <p>I'm working in C# and I try to do a program that get some infoes the files in a Directory. I made it but i have a problem with the error Handling. When the program runs and for example I give just random numbers to list file infoes i get this error message: </p>
  
  <blockquote>
    <p>"System.IO.DirectoryNotFoundException: "'Could not find a part of the path 'C:\Temp\first_project\first_project\bin\Debug\12345'.'"</p>
  </blockquote>
  
  <p>Please someone help me to do the error handling.</p>
  
  <p>Thank you in advance.</p>
  
  <pre><code>using System;
      using System.IO;
      class Test
          {
              static void Main(string[] args)
               {
                  Console.WriteLine("Please :");
                  string hely = Console.ReadLine();
                  string[] __file = Directory.GetFiles(hely);
                  string[] __dir = Directory.GetDirectories(hely);
  
                  foreach (string i in __file)
                  {
                      FileInfo fajl = new FileInfo(i);
                      Console.WriteLine("{0},{1},{2}", fajl.Name, fajl.Extension, fajl.LastWriteTime.ToString());
                  }
                  foreach (string i in __dir)
                  {
                      DirectoryInfo _file = new DirectoryInfo(i);
                      Console.WriteLine("{0},{1},{2}", _file.Name, _file.Extension, _file.LastWriteTime.ToString());
                  }
  
  
              Console.ReadKey();
               }
  
          }
  </code></pre>