开发者

How to use the multiselect feature in open file dialog box

开发者 https://www.devze.com 2022-12-22 06:00 出处:网络
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.

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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号