ImageVerifierCode 换一换
格式:DOCX , 页数:22 ,大小:76.55KB ,
资源ID:11329208      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/11329208.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(C#播放器.docx)为本站会员(b****7)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

C#播放器.docx

1、C#播放器以下是全部代码:1.Form1.csusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Collections;namespace 自制影音播放器 public partial class Form1 : Form public Form1() InitializeComponent(); Arra

2、yList strFilenames = new ArrayList(); /存放完整文件名 private void button1_Click(object sender, EventArgs e) OpenFileDialog openFile = new OpenFileDialog(); openFile.Multiselect = true; DialogResult dr = openFile.ShowDialog(); if (dr = DialogResult.OK) int count = lstFilm.Items.Count;/记录添加前的项数 /取得文件主名并在列表框

3、中显示 foreach (string name in openFile.FileNames) strFilenames.Add(name); lstFilm.Items.Add(System.IO.Path.GetFileNameWithoutExtension(name); /默认播放刚添加的第一个 lstFilm.SelectedIndex = count; private void listBox1_SelectedIndexChanged(object sender, EventArgs e) Player.URL = strFilenameslstFilm.SelectedInde

4、x.ToString(); lblTime.Text = 00:00n + Player.currentMedia.durationString; timer1.Enabled = true; private void button2_Click(object sender, EventArgs e) Player.Ctlcontrols.play(); private void button3_Click(object sender, EventArgs e) Player.Ctlcontrols.pause(); private void button4_Click(object send

5、er, EventArgs e) if (lstFilm.SelectedIndex 0) lstFilm.SelectedIndex -= 1; else lstFilm.SelectedIndex = lstFilm.Items.Count - 1; private void button5_Click(object sender, EventArgs e) if (lstFilm.SelectedIndex 1000) trackProcess.TickFrequency = trackProcess.Maximum / 100; else trackProcess.TickFreque

6、ncy = trackProcess.Maximum / 20; /音量 trackVolume.Maximum = 100; trackVolume.Minimum = 0; trackVolume.TickFrequency = 10; trackVolume.Value = Player.settings.volume; lblTime.Text = 00:00n + Player.currentMedia.durationString; private void trackProcess_Scroll(object sender, EventArgs e) Player.Ctlcont

7、rols.currentPosition = trackProcess.Value; private void trackVolume_Scroll(object sender, EventArgs e) Player.settings.volume = trackVolume.Value; private void 退出XToolStripMenuItem_Click(object sender, EventArgs e) Application.Exit(); private void toolStripMenuItem1_Click(object sender, EventArgs e)

8、 strFilenames.Clear(); lstFilm.Items.Clear(); 2.Program.csusing System;using System.Collections.Generic;using System.Windows.Forms;namespace 自制影音播放器 static class Program / / 应用程序的主入口点。 / STAThread static void Main() Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(fals

9、e); Application.Run(new Form1(); 3.Form1.Designer.csnamespace 自制影音播放器 partial class Form1 / / 必需的设计器变量。 / private System.ComponentModel.IContainer components = null; / / 清理所有正在使用的资源。 / / 如果应释放托管资源,为 true;否则为 false。 protected override void Dispose(bool disposing) if (disposing & (components != null)

10、components.Dispose(); base.Dispose(disposing); #region Windows 窗体设计器生成的代码 / / 设计器支持所需的方法 - 不要 / 使用代码编辑器修改此方法的内容。 / private void InitializeComponent() ponents = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourc

11、eManager(typeof(Form1); this.panel1 = new System.Windows.Forms.Panel(); this.splitter1 = new System.Windows.Forms.Splitter(); this.lstFilm = new System.Windows.Forms.ListBox(); this.panel2 = new System.Windows.Forms.Panel(); this.panel4 = new System.Windows.Forms.Panel(); this.trackProcess = new Sys

12、tem.Windows.Forms.TrackBar(); this.lblTime = new System.Windows.Forms.Label(); this.panel3 = new System.Windows.Forms.Panel(); this.panel5 = new System.Windows.Forms.Panel(); this.trackVolume = new System.Windows.Forms.TrackBar(); this.button6 = new System.Windows.Forms.Button(); this.button5 = new

13、System.Windows.Forms.Button(); this.button4 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.文件FToolS

14、tripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.打开OToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.退出XToolStripMe

15、nuItem = new System.Windows.Forms.ToolStripMenuItem(); this.timer1 = new System.Windows.Forms.Timer(ponents); this.toolTip1 = new System.Windows.Forms.ToolTip(ponents); this.Player = new AxWMPLib.AxWindowsMediaPlayer(); this.panel1.SuspendLayout(); this.panel2.SuspendLayout(); this.panel4.SuspendLay

16、out(); (System.ComponentModel.ISupportInitialize)(this.trackProcess).BeginInit(); this.panel3.SuspendLayout(); this.panel5.SuspendLayout(); (System.ComponentModel.ISupportInitialize)(this.trackVolume).BeginInit(); this.menuStrip1.SuspendLayout(); (System.ComponentModel.ISupportInitialize)(this.Playe

17、r).BeginInit(); this.SuspendLayout(); / / panel1 / this.panel1.Controls.Add(this.Player); this.panel1.Controls.Add(this.splitter1); this.panel1.Controls.Add(this.lstFilm); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(0, 24); this.panel1.Name

18、 = panel1; this.panel1.Size = new System.Drawing.Size(534, 289); this.panel1.TabIndex = 2; / / splitter1 / this.splitter1.Location = new System.Drawing.Point(131, 0); this.splitter1.Name = splitter1; this.splitter1.Size = new System.Drawing.Size(3, 289); this.splitter1.TabIndex = 5; this.splitter1.T

19、abStop = false; / / lstFilm / this.lstFilm.Dock = System.Windows.Forms.DockStyle.Left; this.lstFilm.FormattingEnabled = true; this.lstFilm.IntegralHeight = false; this.lstFilm.ItemHeight = 12; this.lstFilm.Location = new System.Drawing.Point(0, 0); this.lstFilm.Name = lstFilm; this.lstFilm.Size = ne

20、w System.Drawing.Size(131, 289); this.lstFilm.TabIndex = 4; this.toolTip1.SetToolTip(this.lstFilm, 播放文件列表); this.lstFilm.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged); / / panel2 / this.panel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.p

21、anel2.Controls.Add(this.panel4); this.panel2.Controls.Add(this.panel3); this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom; this.panel2.Location = new System.Drawing.Point(0, 313); this.panel2.Name = panel2; this.panel2.Size = new System.Drawing.Size(534, 38); this.panel2.TabIndex = 3; / / pan

22、el4 / this.panel4.Controls.Add(this.trackProcess); this.panel4.Controls.Add(this.lblTime); this.panel4.Dock = System.Windows.Forms.DockStyle.Fill; this.panel4.Location = new System.Drawing.Point(297, 0); this.panel4.Name = panel4; this.panel4.Size = new System.Drawing.Size(237, 38); this.panel4.TabI

23、ndex = 1; / / trackProcess / this.trackProcess.AutoSize = false; this.trackProcess.Dock = System.Windows.Forms.DockStyle.Fill; this.trackProcess.Location = new System.Drawing.Point(71, 0); this.trackProcess.Name = trackProcess; this.trackProcess.Size = new System.Drawing.Size(166, 38); this.trackPro

24、cess.TabIndex = 0; this.toolTip1.SetToolTip(this.trackProcess, 播放进度,可以通过拖动滑块进行调节); this.trackProcess.Scroll += new System.EventHandler(this.trackProcess_Scroll); / / lblTime / this.lblTime.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.lblTime.Dock = System.Windows.Forms.DockStyle.

25、Left; this.lblTime.Font = new System.Drawing.Font(宋体, 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)(134); this.lblTime.Location = new System.Drawing.Point(0, 0); this.lblTime.Name = lblTime; this.lblTime.Size = new System.Drawing.Size(71, 38); this.lblTime.TabInd

26、ex = 1; this.lblTime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.toolTip1.SetToolTip(this.lblTime, 已播放时间/总时间); / / panel3 / this.panel3.Controls.Add(this.panel5); this.panel3.Controls.Add(this.button6); this.panel3.Controls.Add(this.button5); this.panel3.Controls.Add(this.button4)

27、; this.panel3.Controls.Add(this.button3); this.panel3.Controls.Add(this.button2); this.panel3.Controls.Add(this.button1); this.panel3.Dock = System.Windows.Forms.DockStyle.Left; this.panel3.Location = new System.Drawing.Point(0, 0); this.panel3.Name = panel3; this.panel3.Size = new System.Drawing.Size(297, 38); this.panel3.TabIndex = 0; / / panel5 / this.panel5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel5.Controls

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1