How to use the multiselect feature in open file dialog box
What code will I put in the open file dialog box_fileok if the multi select feature is enabled. I currently have this code, but it only shows in the textbox the last file that has been selected.
Dim strm As System.IO.Stream
strm = OpenFileDialog3.OpenFile()
TextBox3.Text = OpenFileDialog3.FileName.ToString()
If Not (strm Is Nothing) Then
//insert code to read the file data
s开发者_运维技巧trm.Close()
MessageBox.Show("Done!")
End If
Use the FileNames property. It returns a string array containing all selected files.
TextBox3.Text = String.Join(Environment.NewLine, OpenFileDialog3.FileNames)
' Displays each filename on a separate line
精彩评论