我正在制作一个程序,用户需要在其中加载多个文件。但是,在ListBox
我只需要显示他们加载的文件的文件名但仍然能够使用加载的文件。所以我想隐藏完整路径。这就是我将文件加载到ListBox
现在的方式,但它显示了整个路径:
private void browseBttn_Click(object sender, EventArgs e)
{
OpenFileDialog OpenFileDialog1 = new OpenFileDialog();
OpenFileDialog1.Multiselect = true;
OpenFileDialog1.Filter = "DLL Files|*.dll";
OpenFileDialog1.Title = "Select a Dll File";
if (OpenFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
dllList.Items.AddRange(OpenFileDialog1.FileNames);
}
}