Advertisement
svetoslavhl

Button_Click

Jan 1st, 2014
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. private void button1_Click(object sender, EventArgs e)
  2. {
  3. if (Directory.Exists("D:\\" +textBox1.Text))
  4. {
  5.  
  6.  
  7. string[] listOfFiles = Directory.GetFiles("D:\\" + textBox1.Text);
  8. string files = "";
  9.  
  10. for (int i = 0; i < listOfFiles.Length; i++)
  11. {
  12.  
  13.  
  14. files += listOfFiles[i];
  15. files += ";";
  16.  
  17.  
  18.  
  19.  
  20. }
  21.  
  22. MessageBox.Show(files);
  23.  
  24.  
  25. }
  26.  
  27. else {
  28.  
  29.  
  30. MessageBox.Show("The directory does not exist.");
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement