去掉路径只要文件名可以这样AnsiString Name = ExtractFileName(FileName);其他的你自己动收比较好,给了你详细代码了,你自己就没有成就感了
求分享根据路径获取文件名可以用Path.GetFileName(filePath);
添加歌曲 OpenFileDialog of = new OpenFileDialog(); of.Multiselect =true; DialogResult dr = of.ShowDialog(); if (dr==DialogResult.OK) { //将选中的歌曲添加到歌曲列表中 string[] arr = of.FileNames; foreach (string name in arr) { this.listBox2.Items.Add(name); } } 告诉放哪?怎么用好不?
OpenFileDialog of = new OpenFileDialog();
of.Multiselect =true;
DialogResult dr = of.ShowDialog();
if (dr==DialogResult.OK)
{
//将选中的歌曲添加到歌曲列表中
string[] arr = of.FileNames;
foreach (string name in arr)
{
this.listBox2.Items.Add(name);
}
}
告诉放哪?怎么用好不?