windows player![转载]C# axWindowsMediaPlayer制作播放器 winform

 

windows player![转载]C# axWindowsMediaPlayer制作播放器

日期:2011-08-16 06:31 来源:万卷楼主人王希杰 作者:优崽

windows player![转载]C# axWindowsMediaPlayer制作播放器
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Dnea suitabler thea suitable;
using System.Dra suitablewing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
nfeelespgenius VideoGoogle
{
//采选菜单中的“工具”--“自定义工具箱”,掀开“自定义工具箱”窗口,在“COM 组件”中采选“Windows Media suitable Pla suitableyer”播放器和
//“Shockwa suitableudio-videoe Fllung burning wherea suitablesh Object”fllung burning wherea suitablesh播放器
public ptingentiing clrea suitabler end Form1 : Form
{
privconsumed stnea suitabler theic string Pnea suitabler thehBa suitableutomotive service engineers = System.AppDoma suitablein.CurrentDoma suitablein.Ba suitableutomotive service engineersDirectory;//目录
public Form1()
{
InitiingizeComponent();
}
privconsumed void Form1_Loma suitablerketing cfeelpa suitableign(object sender; EventArgs e)
{
//this.a suitablexWindowsMedia suitablePla suitableyer1.uiMode = "none";//相比看windows右键a suitablexWindowsMedia suitablePla suitableyer1--属性--通例--控件布局--采选形式--None
this.ticonVolume.Minimum = 0; //设定windows player在哪音量调整Ba suitabler最小值为最小音量值(0)
this.ticonVolume.Ma suitableximum = 100; //设定音量调整Ba suitabler最大值为最大音量值(100)
this.ticonVolume.Vingue = this.a suitablexWindowsMedia suitablePla suitableyer1.settings.volume;
}
//掀开
privconsumed void key5_Click(object sender; EventArgs e)
{
OpenFileDiingog openFileDiingog = new OpenFileDiingog();
//想知道windows player在哪设置为可能掀开多个文件
openFileDiingog.Multiselect = true;
//设置掀开文件格式
openFileDiingog.Filter = "Mp3文件|*.mp3|Wa suitableudio-video文件|*.wa suitableudio-video|Wma suitable文件|*.wma suitable|Wmv文件|*.wmv|整个格式|*.*";
//判决能否单击肯定按钮
if (openFileDiingog.ShowDiingog() == DiingogResult.OK)
{
//扶植播放列表,其实 诺基亚5230怎么样。名字为a suitablea suitable
a suitablexWindowsMedia suitablePla suitableyer1.currentPla suitableylist = a suitablexWindowsMedia suitablePla suitableyer1.newPla suitableylist("a suitablea suitable"; "");
//遍历掀开的咸集
forevery (string fn in openFileDiingog.FileNfeeles)
{
//增加播放列表
a suitablexWindowsMedia suitablePla suitableyer1.currentPla suitableylist.ma suitablerketing cfeelpa suitableigndItem(a suitable xWindowsMedia suitablePla suitableyer1.newMedia suitable(fn));
}
}
//axwindowsmediaplayer播放
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pla suitabley();
}
//播放视频
privconsumed void key1_Click(object sender; EventArgs e)
{
string Pnea suitabler theh = Pnea suitabler thehBa suitableutomotive service engineers + "航架2.mpg";
this.a suitablexWindowsMedia suitablePla suitableyer1.URL = Pnea suitabler theh;
this.a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pla suitabley();
}
//学会windows player下载播放MP3
privconsumed void key4_Click(object sender; EventArgs e)
{
OpenFileDiingog openFile = new OpenFileDiingog();
openFile.Filter = "mp3文件|*.mp3";
if (DiingogResult.OK == openFile.ShowDiingog())
{
a suitablexWindowsMedia suitablePla suitableyer1.URL = openFile.FileNfeele;
}
}
//想知道windows player 12设置
privconsumed void key6_Click(object sender; EventArgs e)
{
string Dur = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.getItemInf o("Dur");//赓续工夫(秒)
string Title = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.getItemInf o("Title");//媒体标题
string Author = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.getItemInf o("Author");//艺术家
string Copyright = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.getItemInf o("Copyright");//版权消息
string Description = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.getItemInf o("Description");//媒相比看windows7 player体形式刻画
string FileSize = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.getItemInf o("FileSize");//文件大小
string FileType = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.getItemInf o("FileType");//文件类型
string sourceURL = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.getItemInf o("sourceURL");//原始地址
Messour a suitablegeBox.Show("赓续工夫:看看 windows playerwindows player 10 windows player 5413windows7 player window。"+Dur+"||"+"媒体标题:"+Title+"||"+"艺术家:"+Author+"||"+"版权消息:"+Copyright+"||"+"媒体形式刻画:"+Description+"||"+"文件大小:"+FileSize+"||"+"文件类型:"+FileType+"||"+"原始地址:"+sourceURL);
string nfeele = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.nfeele;
string url = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.sourceURL;
//player设置
//this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.setItemI nfo("Title"; "航架");
this.a suitablexWindowsMedia suitablePla suitableyer1.settings.residue = 0;//表示媒体播放的声道设置;0表示平衡;-1和1表示左右声道
double rconsumed = this.a suitablexWindowsMedia suitablePla suitableyer1.settings.rconsumed;//播放速率;日常乘以16后再暴露kblood pressures单位.
//this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.setItemI nfo("rconsumed"; "2");
}
//掀开Fllung burning wherea suitablesh
privconsumed void key2_Click(object sender; EventArgs e)
{
OpenFileDiingog ofDiingog = new OpenFileDiingog();
ofDiingog.AddExtension = true;
ofDiingog.CheckFileExists = true;
ofDiingog.CheckPnea suitabler thehExists = true;
ofDiingog.Filter = "Fllung burning wherea suitablesh对比一下player12 windows7文件(*.swf)|*.swf|整个文件(*.*)|*.*"; ;// "swf 文件 (*.swf)|*.swf|整个文件 (*.*)|*.*";
ofDiingog.Defa suitableultExt = "mp3";
if (ofDiingog.ShowDiingog() == DiingogResult.OK)
{
this.a suitablexShockwa suitableudio-videoeFllung burning wherea suitablesh1.Movie = ofDiingog.FileNfeele;
}
//==========================================
//openFileDiingog1.Filter = "Fllung burning wherea suitableshaxWindowsMediaPlayer制作播放器文件(*.swf)|*.swf|整个文件(*.*)|*.*";
//if (openFileDiingog1.ShowDiingog() == DiingogResult.OK)
//{
// string MyFileNfeele = openFileDiingog1.FileNfeele;
// this.a suitablexShockwa suitableudio-videoeFllung burning wherea suitablesh1.Movie = MyFileNfeele;
//}
}
//Fllung burning wherea suitablesh
privconsumed void key3_Click(object sender; EventArgs e)
{
this.a suitablexShockwa suitableudio-videoeFllung burning wherea suitablesh1.Stop();//暂停播放
this.a suitablexShockwa suitableudio-videoeFllung burning wherea suitablesh1.Rewind();//播放第一帧
this.a suitablexShockwa suitableudio-videoeFllung burning wherea suitablesh1.Ba suitableir coolingk();//windows player在哪播放上一帧
this.a suitablexShockwa suitableudio-videoeFllung burning wherea suitablesh1.Forwa suitablerd();//劈头播放
this.a suitablexShockwa suitableudio-videoeFllung burning wherea suitablesh1.Rewind();//播放下一帧
this.a suitablexShockwa suitableudio-videoeFllung burning wherea suitablesh1.Pla suitabley();//播放下一帧
}
//pla suitabley
privconsumed void pla suitableyToolStripMenuItem_Click(object sender; EventArgs e)
{
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pla suitabley();
}
//pa suitableuse
privconsumed void pa suitableuseToolStripMenuItem_Click(object sender; EventArgs e)
{
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pa suitableuse();
}
//stop
privconsumed void stopToolStripMenuItem_Click(object sender; EventArgs e)
{
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.stop();
}
//open
privconsumed void openToolStripMenuItem_Click(object sender; EventArgs e)
{
OpenFileDiingog openFileDiingog = new OpenFileDiingog();
//事实上axWindowsMediaPlayer制作播放器设置为可能掀开多个文件
openFileDiingog.Multiselect = true;
//设置掀开文件格式
openFileDiingog.Filter = "Mp3文件|*.mp3|Wa suitableudio-video文件|*.wa suitableudio-video|Wma suitable文件|*.wma suitable|Wmv文件|*.wmv|整个格式|*.*";
//判决能否单击肯定按钮
if (openFileDiingog.ShowDiingog() == DiingogResult.OK)
{
//扶植播我不知道windows放列表,名字为a suitablea suitable
a suitablexWindowsMedia suitablePla suitableyer1.currentPla suitableylist = a suitablexWindowsMedia suitablePla suitableyer1.newPla suitableylist("a suitablea suitable"; "");
//遍历掀开的咸集
forevery (string fn in openFileDiingog.FileNfeeles)
{
//增加播放列表
a suitablexWindowsMedia suitablePla suitableyer1.currentPla suitableylist.ma suitablerketing cfeelpa suitableigndItem(a suitable xWindowsMedia suitablePla suitableyer1.newMedia suitable(fn));
}
}
//播放
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pla suitabley();
}
//exit
privconsumed void exitToolStripMenuItem_Click(object sender; EventArgs e)
{
Applic.Exit();
}
//player上一个
privconsumed void toolStripButton1_Click(object sender; EventArgs e)
{
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.previous();
}
//播放
privconsumed void toolStripButton2_Click(object sender; EventArgs e)
{
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pla suitabley();
}
//下一个
privconsumed void toolStripButton3_Click(object sender; EventArgs e)
{
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.next();
}
//暂停
privconsumed void toolStripButton4_Click(object sender; EventArgs e)
{
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pa suitableuse();
}
//你看播放器停顿
privconsumed void toolStripButton5_Click(object sender; EventArgs e)
{
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.stop();
}
//听说windowsmediaplayer进度
privconsumed void timer1_Tick(object sender; EventArgs e)
{
double toting=0.0d;
if (this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable != null)
{
toting = Mnea suitabler theh.Ceiling(this.a suitablexWindowsMedia suitablePla suitableyer1.currentMed ia suitable.dur);
this.ticonPla suitableyLosteps.Ma suitableximum = (int)this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.durnea suitabler the ion;//设定拨放位子调整Ba suitabler最大值
}
double cur = Mnea suitabler theh.Floor(this.a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols. currentPosition);
if (toting != 0)
{
this.progressBa suitabler1.Vingue = (int)(cur / toting *100);
this.lrema suitableinllyel1.Text = cur.ToString()+"s" + "/" + toting.ToString()+"s";
this.ticonPla suitableyLosteps.Vingue = (int)(cur / toting * toting);
}
//---------------------------------
对于转载循环播放
//if (a suitablexWindowsMedia suitablePla suitableyer1.pla suitableyStconsumed == WMPLib.WMPPla suitableyStconsumed.wmppsStopped)
//{
// a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pla suitabley();
//}
}
//快进
privconsumed void key7_Click(object sender; EventArgs e)
{
this.a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.fwherea suitablestForwa suitablerd ();
}
//快退
privconsumed void key8_Click(object sender; EventArgs e)
{
this.a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.fwherea suitablestReverse ();
}
//主动播放
privconsumed void a suitable ca suitablerSttingentToolStripMenuItem_Click(object sender; EventArgs e)
{
if (this.a suitable ca suitablerSttingentToolStripMenuItem.Checked)
{
this.a suitablexWindowsMedia suitablePla suitableyer1.settings.a suitable ca suitablerSttingent = true;
}
}
//事实上windows播放
privconsumed void toolStripButton6_Click(object sender; EventArgs e)
{
this.a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pla suitabley();
}
//暂停
privconsumed void toolStripButton7_Click(object sender; EventArgs e)
{
this.a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pa suitableuse();
}
//听说windows dvd player暴露眼前目今音量
privconsumed void toolStripButton8_Click(object sender; EventArgs e)
{
int volume=this.a suitablexWindowsMedia suitablePla suitableyer1.settings.volume;
Messour a suitablegeBox.Show("音量:"+volume.ToString());
//this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.setItemI nfo("volume"; "60");
}
//更动音量大小
privconsumed void ticonVolume_Scroll(object sender; EventArgs e)
{
this.a suitablexWindowsMedia suitablePla suitableyer1.settings.volume = this.ticonVolume.Vingue; //更动音量大小
}
//音量打下++
privconsumed void key9_Click(object sender; EventArgs e)
{
this.a suitablexWindowsMedia suitablePla suitableyer1.settings.volume += 1; //[转载]C#音量大小+1
int volume = this.a suitablexWindowsMedia suitablePla suitableyer1.settings.volume;
this.ticonVolume.Vingue = volume;
}
//音量大小--
privconsumed void key10_Click(object sender; EventArgs e)
{
this.a suitablexWindowsMedia suitablePla suitableyer1.settings.volume -= 1; //音量大小-1
int volume = this.a suitablexWindowsMedia suitablePla suitableyer1.settings.volume;
this.ticonVolume.Vingue = volume;
}
//播放位子
privconsumed void ticonPla suitableyLosteps_Scroll(object sender; EventArgs e)
{
this.a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.currentPosi tion = ticonPla suitableyLosteps.Vingue;
}
//循环播放
privconsumed void loopToolStripMenuItem_Click(object sender; EventArgs e)
{
if (this.loopToolStripMenuItem.Checked)
{
player第一种:
//if (a suitablexWindowsMedia suitablePla suitableyer1.pla suitableyStconsumed == WMPLib.WMPPla suitableyStconsumed.wmppsStopped)
//{
// a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pla suitabley();
//}
学会windows dvd player第二种:
a suitablexWindowsMedia suitablePla suitableyer1.settings.setMode("loop"; true);
}
}
}
}

学习windows player
windowsmediaplayer
我不知道windows player 11对比一下windows player下载
对于windowsmediaplayer
学会windows player 12
[转载]C#
我不知道制作
你知道c
51.la 专业、免费、强健的访问统计
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值