OpenFileDialog openFileDialog1 = new OpenFileDialog
            {
                InitialDirectory = "c:\\",
                Filter = "音频文件(*.mp3,*.s48)|*.Mp3;*.s48",
                FilterIndex = 2,
                RestoreDirectory = true
            };     //显示选择文件对话框
            var path = "";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                path = openFileDialog1.FileName;          //显示文件路径
            }
            if (path.Length == 0)
            {
                MessageBox.Show("您还没有选择任何文件!");
                return;
            }
            IWMPMedia mediaInfo = axWindowsMediaPlayer1.newMedia(path);

            axWindowsMediaPlayer1.URL = path;
            MessageBox.Show(mediaInfo.duration.ToString());

  

相关文章:

  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-10
  • 2021-12-30
  • 2022-02-17
猜你喜欢
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2021-06-29
相关资源
相似解决方案