I have a form that generates 2 text files.
Each comprises a list of directories at a given location; displayed in a list box and output to text file.
Ideally I would like ONE text file, with EACH list in it. Both directories will always be the same so I can read the file and the entries will line up.
So...I have tried creating a single file and adding both arrays - and failed
I have tried creating a single array, populated with both lists - and failed.
Could anybody point me (a novice) in the right direction, please?
private void button5_Click(object sender, EventArgs e)
//list the source
string sfolders = System.IO.Directory.GetDirectories(@"R:\data\lister\", "*", System.IO.SearchOption.AllDirectories);
foreach (string s in sfolders)
listBox2.DataSource = sfolders;
//list the destination
string dfolders = System.IO.Directory.GetDirectories(@"C:\lister\", "*", System.IO.SearchOption.AllDirectories);
foreach (string d in dfolders)
listBox3.DataSource = dfolders;