播放mp3文件时,一般windows media player右下角都会显示显示播放时间,
现在怎么编程把播放时的时间显示出来,
最好能提供一下具体的代码和必要的注释,因为本人水平很差。

解决方案 »

  1.   

    http://www.codeproject.com/KB/WPF/podder1.aspx
    下载回来看看吧~写的很棒的
      

  2.   

     DateTime.ToString();放到你的播放器的这个某个位置也可以撒 加个漂亮点的Label之类的吧
      

  3.   

      string duration = "";
    rivate void timer1_Tick(object sender, EventArgs e)
            {
                duration = this.axWmp.currentMedia.durationString;
    this.lblDuration.Text = Duration;
            }
      

  4.   

    哦你显示播放时间哈,那你作个
    DateTime dt=播放时的时间记录
    DateSpan ds= DateTime.Now-dt;
    Label showTime;
    用线程更新Thread t=new Thread(()=>{
      while(播放没停止){
         this.showTime.Invoke(Delegate.CreateDelegate(typeof(Action),this,
    "ShowTime"));
         Thread.Sleep(1000);
      }
    });
    void ShowTime(){
      this.showTime.Text=(DateTime.Now-dt).ToShortString();
    }