详细一点哦  ...

解决方案 »

  1.   

    using System.Media; 
    using System.IO; 
    SoundPlayer music = new SoundPlayer(); 
    music = new SoundPlayer(""); 
    music.Play(); 
    或 
    [DllImport("winmm.dll")] 
    public static extern long PlaySound(String fileName,long a,long b); [DllImport("winmm.dll")] 
          public static extern long mciSendString(string lpstrCommand,string lpstrReturnString,long length,long hwndcallback); 
          public static void PlayMusic(string p_FileName) 
            { 
            try 
              { 
      mciSendString(@"close "+p_FileName ,"",0,0); 
      mciSendString(@"open " + p_FileName,"",0,0); 
      mciSendString(@"play " + p_FileName ,"",0,0); 
            } 
              catch 
                { 
                } 
          } 
      

  2.   

    我想应该开个线程用PlaySound不停的播放你的声音文件吧!
      

  3.   

    SoundPlayer Player = new SoundPlayer();
    this.Player.SoundLocation = @"C:\123.wav";
    this.Player.Play();
      

  4.   

    using System.Media;  
    using System.IO;  
    SoundPlayer music = new SoundPlayer();  
    music = new SoundPlayer("");  
    music.Play();  
      

  5.   

    选择菜单中的“工具”中的“自定义工具箱(添加/移除工具箱项)”,在自定义工具箱的窗口中,点击展开“COM 组件”项,选中“Window Media Player”选项。确定后在“工具箱”中便会出现“Windows Media Player”这一项,然后再将其拖至Form上,将可见属性改为false,把AutoStart设置成为true(其实默认是true),
    在form的load()中加入
    axWindowsMediaPlayer1.URL = "C:\\123.mp3";
      

  6.   

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;namespace music
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }        private void Form1_Load(object sender, EventArgs e)
            {
                System.Media.SoundPlayer sp = new System.Media.SoundPlayer();
                sp.SoundLocation = System.IO.Directory.GetCurrentDirectory ()+ "\\1.wav";
                sp.PlayLooping();
            }
        }
    }
      

  7.   

    把"1.WAV"放在DEBUG下的BIN就行了
      

  8.   


                //相对路径
                //sp.SoundLocation = @"alert1.wav";        //在bin\Debug 文件夹下。
                //sp.SoundLocation = @"music\alert1.wav";  //在bin\Debug\music 文件夹下。
                //sp.SoundLocation = Application.StartupPath + @"\alert1.wav";
                //sp.SoundLocation = Application.StartupPath + @"\music\alert1.wav";            //绝对路径
                sp.SoundLocation = @"F:\Visual Studio 2008\Projects\PersonalABC\bin\Debug\alert.wav";            sp.Play();
      

  9.   

    用2楼如梦的,如果要播放mp3就得用api的,5楼的只能播放wav,而且功能不很全的,api功能很是齐全的,在网上搜一下,很多例子
      

  10.   

    加个线程,然后在线程里播放你要的背景音乐,具体的是播放wav或者MP3,代码可以在网上搜,一堆一堆的,wav简单,直接用SoundPlayer 就行,MP3需要调用下系统的API
      

  11.   

    如果里面的路径我用openFileDialog1来提示用户自己选择歌曲然后再把其中获取的路径添加到播放音乐那里后面如果不加.MP3或者.WAV后缀,那该如何实现呢?
      

  12.   

    还是用引用DirectX去插放吧。用控件比较麻烦,还要添加到form里。