📅  最后修改于: 2022-03-11 14:49:23.941000             🧑  作者: Mango
using (OpenFileDialog openFileDialog1 = new OpenFileDialog())
{
openFileDialog1.InitialDirectory = "c:\\Users\\MarcoGT\\Music";
openFileDialog1.Filter = "Musics(*.wav)|*.wav*";
openFileDialog1.FilterIndex = 2;
openFileDialog1.RestoreDirectory = true;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
//do what you want with the file location
}