private string[] ChooseFilters()
{
string[] path;
OpenFileDialog ofd = new OpenFileDialog();
ofd.InitialDirectory = "C:\\Users\\89180\\Desktop\\";
//ofd.InitialDirectory = "C:/Users/89180/Desktop/";
ofd.Multiselect = true;
ofd.Filter = "所有文件(*.*)|*.*|音乐文件(*.mp3)|*.mp3";
ofd.ShowDialog();
path = ofd.FileNames;
ofd.Dispose();
return path;
}
使用\,对话框打开时,在我的桌面文件夹下(路径:C:\Users\89180\Desktop),正常;
使用/,对话框打开时,是我的桌面文件夹下的一个文件夹(路径:C:\Users\89180\Desktop\音乐\),错误