爱吃酸菜鱼的猫

选择文件,显示其路径在ListBox控件里

 

        private void btnSelect_Click(object sender, EventArgs e)
        {
            lbxFiles.Items.Clear();
            OpenFileDialog file = new OpenFileDialog();
            file.Multiselect = true;//允许选择多个文件
            if (file.ShowDialog() == DialogResult.OK)
            {
                lbxFiles.Items.AddRange(file.FileNames);
            }
        }

posted on 2018-04-16 14:26  爱吃酸菜鱼的猫  阅读(509)  评论(0编辑  收藏  举报

导航