2011-08-08 4 views

답변

0

다음은 .NET 응용 프로그램에 내장 된 오디오 리소스를 재생하기위한 솔루션입니다.

  Dim mSound As String = "Bell" 
      Dim strNameSpace As String = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name.ToString() 
      Dim mRes As Resources.ResourceManager = New Resources.ResourceManager(strNameSpace & ".Resources", Assembly.GetExecutingAssembly) 
      If mRes IsNot Nothing Then 
       Dim mSoundStream As Stream = mRes.GetStream(mSound) 
       If mSoundStream IsNot Nothing Then 
        Dim mPlayer As SoundPlayer = New SoundPlayer(mSoundStream) 
        mPlayer.Play() 
        mPlayer.Dispose() 
        mSoundStream.Close() 
        mSoundStream.Dispose() 
       End If 
      End If 
관련 문제