资源简介
为了吸引10岁儿子学习编程,告别枯燥,特意改写了这位兄弟的共享代码,谢谢原作者!原版http://download.csdn.net/detail/y85171642/6519511

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.DirectX.DirectSound;
using System.Threading;
namespace PlayPlane_01
{
class DXPlay
{
private string musicPath;
Form1 form;
public DXPlay(Form1 formstring musicPath)
{
this.form = form;
this.musicPath = musicPath;
}
public void Play()
{
SecondaryBuffer secBuffer;//缓冲区对象
Device secDev;//设备对象
secDev = new Device();
secDev.SetCooperativeLevel(form CooperativeLevel.Normal);//设置设备协作级别
secBuffer = new SecondaryBuffer(musicPath secDev);//创建辅助缓冲区
secBuffer.Play(0 BufferPlayFlags.Default);//设置缓冲区为默认播放
}
delegate void DelegatePlay();
public void ThreadPlay()
{
Thread t = new Thread(new ThreadStart(CorssThreadPlay));
t.Start();
}
public void CorssThreadPlay()
{
if (form.InvokeRequired)
{
DelegatePlay dp = new DelegatePlay(CorssThreadPlay);
form.Invoke(dp);
}
else
{
SecondaryBuffer secBuffer;//缓冲区对象
Device secDev;//设备对象
secDev = new Device();
secDev.SetCooperativeLevel(form CooperativeLevel.Normal);//设置设备协作级别
secBuffer = new SecondaryBuffer(musicPath secDev);//创建辅助缓冲区
secBuffer.Play(0 BufferPlayFlags.Default);//设置缓冲区为默认播放
}
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
.CA.... 178176 2005-03-18 16:23 PlayPlane_01\bin\Debug\dll\Microsoft.DirectX.DirectSound.dll
.CA.... 223232 2005-03-18 16:23 PlayPlane_01\bin\Debug\dll\Microsoft.DirectX.dll
.CA.... 28672 2017-07-14 18:01 PlayPlane_01\bin\Debug\PlayPlane_01.exe
.CA.... 56832 2017-07-14 18:01 PlayPlane_01\bin\Debug\PlayPlane_01.pdb
.CA.... 11608 2017-07-14 18:02 PlayPlane_01\bin\Debug\PlayPlane_01.vshost.exe
.CA.... 490 2013-03-18 17:00 PlayPlane_01\bin\Debug\PlayPlane_01.vshost.exe.manifest
.CA.... 25282 2013-08-23 11:22 PlayPlane_01\bin\Debug\resource\bg_01.jpg
.CA.... 26800 2013-08-23 11:22 PlayPlane_01\bin\Debug\resource\bg_02.jpg
.CA.... 14124 1992-09-10 10:59 PlayPlane_01\bin\Debug\resource\BOMB3.WAV
.CA.... 25382 1995-06-29 13:25 PlayPlane_01\bin\Debug\resource\BOMB5.WAV
.CA.... 11303 2013-08-23 11:22 PlayPlane_01\bin\Debug\resource\explosion.mp3
.CA.... 55244 2013-11-05 22:45 PlayPlane_01\bin\Debug\resource\explosion.wav
.CA.... 3391 2013-08-23 11:37 PlayPlane_01\bin\Debug\resource\font.fnt
.CA.... 5622 2013-08-23 11:22 PlayPlane_01\bin\Debug\resource\font_0.png
.CA.... 6074 2013-08-26 11:10 PlayPlane_01\bin\Debug\resource\icon36x36 - 副本.png
.CA.... 6074 2013-08-26 11:10 PlayPlane_01\bin\Debug\resource\icon36x36.png
.CA.... 8111 2013-08-26 11:10 PlayPlane_01\bin\Debug\resource\icon48x48.png
.CA.... 12047 2013-08-26 11:10 PlayPlane_01\bin\Debug\resource\icon72x72.png
.CA.... 6191 2013-08-26 15:27 PlayPlane_01\bin\Debug\resource\loading.gif
.CA.... 39900 2017-07-14 16:44 PlayPlane_01\bin\Debug\resource\plane\A-10A Thunderbolt II.png
.CA.... 35180 2017-07-14 16:44 PlayPlane_01\bin\Debug\resource\plane\AV-8B Harrier II.png
.CA.... 32724 2017-07-14 16:45 PlayPlane_01\bin\Debug\resource\plane\F-117A Night Hawk.png
.CA.... 41964 2017-07-14 16:43 PlayPlane_01\bin\Debug\resource\plane\F-14B Tomcat.png
.CA.... 28434 2017-07-14 16:45 PlayPlane_01\bin\Debug\resource\plane\F-15C Eagle.png
.CA.... 30335 2017-07-14 16:45 PlayPlane_01\bin\Debug\resource\plane\F-15E Strike Eagle.png
.CA.... 32420 2017-07-14 16:45 PlayPlane_01\bin\Debug\resource\plane\F-16A Fighting Falcon.png
.CA.... 37813 2017-07-14 16:43 PlayPlane_01\bin\Debug\resource\plane\F-4C Phantom II.png
.CA.... 36433 2017-07-14 16:43 PlayPlane_01\bin\Debug\resource\plane\F-4J Phantom II.png
.CA.... 31483 2017-07-14 16:44 PlayPlane_01\bin\Debug\resource\plane\F-A-18C Hornet.png
.CA.... 27583 2017-07-14 16:44 PlayPlane_01\bin\Debug\resource\plane\MiG-21F Fishbed.png
............此处省略99个文件信息
相关资源
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
- C#指纹识别系统程序 报告
- c# 高校档案信息管理系统
评论
共有 条评论