选择文件,显示其路径在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);
}
}