How to know how many files selected in opendialog in c# ?
How to know how many selected files in opendialog in c#?
2.5k views Asked by SWE At
5
There are 5 answers
2
On
private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
{
openFileDialog1.Multiselect = true;
}
private void button1_Click(object sender, EventArgs e)
{
DialogResult result = openFileDialog1.ShowDialog();
if (result == DialogResult.OK)
{
List<string> fff = openFileDialog1.FileNames.ToList();
// Do something with the list
}
}
.FileNames will probably hold the count of selected items :)