我用C#接收到了邮件,现在只要有新邮件的时候能有声音提醒,请问,声音提醒是给个音频文件播放,还是怎么的?
哪个有个这样的音频文件的啊?

解决方案 »

  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.   

    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  
      {  
      }  
      }   
      

  3.   


    我是在wince上做的,可不可以弄个想xp系统上一样的exe文件,调用就行了啊