中用实现等音频文件的播放类覆盖

电工电气2021年09月06日

二、用于测试媒体播放类的简单代码:

using System;

using awing;

using llections;

using ponentModel;

using rms;

using ta;

using eropServices;

using xt;

using ;

using clsMCIPlay;

namespace MCIPlay

{

/// summary

/// Form1 的摘要说明。

/// /summary

public class Form1 : rm

{

private ontainer components;

private mer timer1;

private tton Play;

private tton Stop;

private tton Puase;

private bel PlayFileName;

private bel Duration;

private bel CurrentPosition;

private enFileDialog openFileDialog1;

private tton BrowserFile;

clsMCI mp = new clsMCI();

public Form1()

{

//

// Windows 窗体设计器支持所必需的

//

InitializeComponent();

//

// TODO: 在 InitializeComponent 调用后添加任何构造函数代码

//

}

/// summary

/// 清理所有正在使用的资源。

/// /summary

protected override void Dispose( bool disposing )

{

if( disposing )

{

if (components != null)

{

spose();

}

}

spose( disposing );

}

#region Windows 窗体设计器生成的代码

/// summary

/// 设计器支持所需的方法 - 不要使用代码器修改

/// 此方法的内容。

/// /summary

private void InitializeComponent()

{

ponents = new ntainer();

ay = new tton();

ayFileName = new bel();

ration = new bel();

op = new tton();

ase = new tton();

rrentPosition = new bel();

mer1 = new mer(ponents);

enFileDialog1 = new enFileDialog();

owserFile = new tton();

spendLayout();

//

// Play

//

cation = new int(102, 243);

= \"Play\";

ze = new ze(78, 24);

bIndex = 0;

xt = \"Play\";

ick += new entHandler(ay_Click);

//

// PlayFileName

//

toSize = true;

cation = new int(12, 15);

= \"PlayFileName\";

ze = new ze(0, 17);

bIndex = 1;

//

// Duration

//

toSize = true;

cation = new int(15, 51);

= \"Duration\";

ze = new ze(0, 17);

bIndex = 2;

//

// Stop

//

cation = new int(282, 243);

= \"Stop\";

ze = new ze(81, 24);

bIndex = 3;

xt = \"Stop\";

ick += new entHandler(op_Click);

//

// Puase

//

cation = new int(198, 243);

= \"Puase\";

ze = new ze(72, 24);

bIndex = 4;

xt = \"Puase\";

ick += new entHandler(ase_Click);

//

// CurrentPosition

//

toSize = true;

cation = new int(15, 87);

= \"CurrentPosition\";

ze = new ze(0, 17);

bIndex = 5;

//

// timer1

//

abled = true;

erval = 1000;

ck += new entHandler(mer1_Tick);

//

// BrowserFile

//

cation = new int(312, 165);

= \"BrowserFile\";

ze = new ze(87, 24);

bIndex = 6;

xt = \"SelectFile\";

ick += new entHandler(owserFile_Click);

//

// Form1

//

toScaleBaseSize = new ze(6, 14);

ientSize = new ze(433, 287);

d(owserFile);

d(rrentPosition);

d(ase);

d(op);

d(ration);

d(ayFileName);

d(ay);

= \"Form1\";

xt = \"Form1\";

sumeLayout(false);

}

#endregion

/// summary

/// 应用程序的主入口点。

/// /summary

[STAThread]

static void Main()

{

n(new Form1());

}

//选择MP3文件播放

private void Play_Click(object sender, entArgs e)

{

try

{

ay();

}

catch

{

ow(\"出错错误!\");

}

产能过剩问题随之又被提了出来 }

//暂停播放

private void Puase_Click(object sender, entArgs e)

{

try

{

ase();

}

catch

{

ow(\"出错错误!\");

}

}

//停止播放

private void Stop_Click(object sender, entArgs e)

{

try

{

opT();

}

catch

{

ow(\"出错错误!\");

}

}

//每秒显示一次播放进度

private void timer1_Tick(object sender, entArgs e)

{

xt = String();

}

//浏览文件

private void BrowserFile_Click(object sender, entArgs e)

{

try

{

lter = \"*.mp3|*.mp3\";

leName = \"\";

if(owDialog() == )

{

leName = leName ;

xt = leName ;

xt = String() ;

}

}

catch

{

ow(\"出错错误!\");

}

}

}

}

本程序在.net 2003 、win XP SP1下编译通过。

查看本文来源

伤口久不愈合的一招灵
许昌医院白癜风
合肥子宫内膜炎治疗哪家好
相关阅读
精彩绝伦!首回合四比三,曼城顶入,皇家马德里还有戏

欧洲各国顶级足罚球现在来到了赛季尾声,当然收到世人推崇的欧联也不都只...

2024-09-05
吹拉弹颂唱响曲(二)——观赏《往日国乐》两年情思小结

原文 / 米木桥 吹拉枪弹诗天天向上歌 —游玩《日星西乐》两年情思小结 20...

2024-05-05
2022二级建造师《建设工程法律法规及相关知识》真题答案及解析

2022二级建造师《工程工程项目法规及之外经验》真题诗究竟及解 一、每项选...

2023-12-07
妈妈本想给宝宝拍大片,谁曾想宝宝的小步伐亮了,网友:实在太可爱了

记录海绵的成长历程是每一个幼儿都只想做的事情。幼儿们也善用了很多分析...

2023-11-23
美股短线跳水,三大股指尽数转跌

铝媒体 App 5月20日第一时间,美股短线艺术体操,三大期货剩余转跌。截至目...

2023-11-22
Aspex Management (HK) Limited平安保险美兰空港(00357)49.3万股

香港联交所最新资料显示,7同年5日,Aspex Management (HK) Limited年末美兰空港(00...

2023-11-18
友情链接