There are numerous ways to approact this.
Here is a very simple example to get you started:
Code:
private void cmdDisplay_Click(object sender, System.EventArgs e)
{
cboFiles.Items.Clear();
string[] files = Directory.GetFiles("C:\\", "*.txt");
foreach(string s in files)
{
cboFiles.Items.Add(s);
}
}
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.
Woody Z
http://www.learntoprogramnow.com
How to use a forum to help solve problems