There are numerous ways to approact this.
Here is a very simple example to get you started:
private void cmdDisplay_Click(object sender, System.EventArgs e)
string files = Directory.GetFiles("C:\\", "*.txt");
foreach(string s in files)
This code just gets and displays the ".txt" files in the C: directory. The Directory.GetFiles method is a static method so you do not instantiate a Directory object.
There are more powerful and better ways to do this, but this should get you started.
How to use a forum to help solve problems