title: Order filenames by number
body: <p>I have been working on a c# image viewer that will read images from my computer and show them in the program.</p>
  
  <pre><code>//foreach file in path display the filename
  
  foreach (var filename in Directory.GetFiles(&lt;path&gt;))
  {
      MessageBox.show(filename);
  }
  
  //Get image by number
  
  var image = Directory.GetFiles(&lt;path&gt;).elementatordefault(&lt;picnumber&gt;).tostring());
  </code></pre>
  
  <p>My problem is that even if my images are ranked in order in the folder: 1,2,3,4 .....12,13,14....101,102, my application will show the files in the following order: 1,101,102,12,13,2...</p>
  
  <p>How would I show the images in the correct like they are in the folder of the pc?
  I can't believe I would need to add each file to an array or list and then preform a sorting algorithm... (I would also need to split the file path and extension)there must be a simpler way of doing this,any help would be much appreciated.</p>