Hello @jcosep,
Well this is what i've understood:
1- you have two buttons to browse and 2 textboxes to show the file name you have selected with respective button.
2- And then you have some "Run Process" type of button and on click of this button you want to process all the files selected in the above textboxes.
Well the problem is in your
foreach loop you are referring
openFileDialog instance, which i believe, is global, hence whatever button you will click in last will overwrite its
FileNames property. Instead you should use the values in the textboxes:
foreach (String TheFileNamePlusPath in openFileDialog.FileNames)
{
runProcess(TheFileNamePlusPath);
}
replace with (i.e. no foreach loop)
runProcess(textbox1.Text);
runProcess(textbox2.Text);
Hope it will help.
Thanks,
Hemant