title: How to display all the text files that are in the local system to a list box on From Load
body: <p>I am having a list box on my form what i need is i would like to display all the text files that are presented in the local drives to that list box on Form Load can any one help me.</p>
  
  <p>I wrote my code like this</p>
  
  <pre><code>string[] filepaths;
  filepaths = Directory.GetFiles(@"c:\", "*.txt", SearchOption.AllDirectories);
  </code></pre>
  
  <p>But this is throwing an error how can i read the files from all directories</p>