Imports System.IO
Me.soundFolder = String.Format("{0}/sound", System.Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData))
'System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)是代表本机的C:/Documents and Settings/angelina/Local Settings/Application Data这个地址
If Not System.IO.Directory.Exists(Me.soundFolder) Then
System.IO.Directory.CreateDirectory(Me.soundFolder)
End If
If Not System.IO.File.Exists(Me.soundFolder & "/alert.wav") Then
Dim br As New IO.BinaryReader(My.Resources.alert)
Dim wavData() As Byte
wavData = br.ReadBytes(My.Resources.alert.Length)
br.Close()
Dim bw As New IO.FileStream(Me.soundFolder & "/alert.wav", FileMode.Create)
bw.Write(wavData, 0, wavData.Length)
bw.Close()
End If