posts - 77, comments - 54, trackbacks - 0, articles - 0
  IT博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

使用Windows动态链接库读取声音文件!

Posted on 2006-08-19 07:45 东人EP 阅读(620) 评论(0)  编辑 收藏 引用 所属分类: .NET
 1 using  System;
 2 using  System.Collections.Generic;
 3 using  System.ComponentModel;
 4 using  System.Data;
 5 using  System.Drawing;
 6 using  System.Text;
 7 using  System.Windows.Forms;
 8 using  System.Runtime.InteropServices;
 9
10 namespace  PlaySound
11 {
12      public  partial  class  Form1 : Form
13      {
14          //  应用动态连接库
15         [DllImport( " Winmm.dll " )]
16          public   static   extern   long  PlaySound( string  name,  long  module,  long  flag);
17
18          public  Form1()
19          {
20             InitializeComponent();
21         }

22
23          private   void  button1_Click( object  sender, EventArgs e)
24          {
25             PlaySound( @" C:\Program Files\QQ2005\sound\ring.wav " 23 23 );
26         }

27     }

28 }
只有注册用户登录后才能发表评论。