登录 注册
当前位置:主页 > 资源下载 > 9 > Windows平台C#视频播放器

Windows平台C#视频播放器

  • 更新:2024-09-17 22:55:02
  • 大小:1.6MB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:.Net - 课程资源
  • 格式:RAR

资源介绍

C#windows实训题, private void Mp3size() { //获得文件大小 try { FileInfo MyFileInfo = new FileInfo(this.listBoxPlayer.SelectedItem.ToString()); float MyFileSize = (float)MyFileInfo.Length / (1024 * 1024); this.labeMp3Size.Text = MyFileSize.ToString().Substring(0, 6) + "M"; } catch { this.labeMp3Size.Text = ""; } } //保存播放列表 private void savePlayList() { Stream mysavefile; SaveFileDialog saveFileDialog1 = new SaveFileDialog(); saveFileDialog1.Filter = "播放列表文件|*.plt"; saveFileDialog1.InitialDirectory = Application.StartupPath; saveFileDialog1.Title = "Save an Image File"; //saveFileDialog1.ShowDialog(); if (saveFileDialog1.ShowDialog() == DialogResult.OK) { if ((mysavefile = saveFileDialog1.OpenFile()) != null) { // Code to write the stream goes here. //mysavefile.Write(this.listBox1.Items.ToString()); mysavefile.Close(); //保存播放列表 StreamWriter sw = new StreamWriter(saveFileDialog1.FileName); this.listBoxPlayer.SelectedIndex = 0; for (int i = 1; i < this.listBoxPlayer.Items.Count; i++) { sw.WriteLine(this.listBoxPlayer.SelectedItem.ToString()); this.listBoxPlayer.SelectedIndex += 1; } sw.Close(); } } }