Feroz Khan

Feroz Khan

  • NA
  • 63
  • 16.2k

Sort Out List Box by Modified Date.

Mar 18 2015 2:48 PM
in below file is showing from a directroy file but not sort out I need sort out by modified date.
please help me about this... thanks.
  1. private void Receipts_Load(object sender, EventArgs e)  
  2. {  
  3.     try  
  4.     {  
  5.         string[] files = Directory.GetFiles(path);  
  6.   
  7.         foreach (string file in files)  
  8.         {  
  9.             show_receipts_listbox.Items.Add(Path.GetFileName(file));  
  10.         }  
  11.                 
  12.     }  
  13.     catch(Exception ex)  
  14.     {  
  15.         MessageBox.Show(ex.Message, "Error");  
  16.     }  
  17. }  

Answers (13)