wince mobile環境下播放WAV聲音

  [DllImport( "coredll" , EntryPoint =  "PlaySound" )]
         public  static  extern  int  PlaySnd( string  pszSound,  int  hmod,  uint  fdwSound);
         private  void  PlaySound_Click( object  sender, EventArgs e)
         {
          //   int  i = PlaySnd( @"\Temp\test.wav" , 0, 0x00000000 /*SND_SYNC*/ );
             int i = PlaySnd(Globals.GetAppPath() + "\\batchover.wav", 0, 0x00000000/*SND_SYNC*/);
         }
 
 

 

//獲得PDA路徑ui

public static string GetAppPath()
{
string directoryName = Path.GetDirectoryName(Assembly.Load(Assembly.GetExecutingAssembly().GetName()).GetName().CodeBase);
if (directoryName.Length > 0)
{
try
{
if (directoryName[directoryName.Length - 1] != '\\')
{
directoryName = directoryName + @"\";
}
}
catch (Exception)
{
directoryName = "";
}
}
return directoryName;
}spa

相關文章
相關標籤/搜索