level 5
醒真初0G
楼主
代码
Dim B As Audio
Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox2.Click
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
If Label2.Text = 0 Then
B = New Audio(OpenFileDialog1.FileName)
B.Play()
Timer1.Enabled = True
Label2.Text = 100
Else
B.Dispose()
B = New Audio(OpenFileDialog1.FileName)
B.Play()
Timer1.Enabled = True
Label2.Text = 100 End If
End If
End Sub
为什么播放一首歌曲 消耗内存越来越多? 启动才5MB 最高 到50+MB了
而且 B.Dispose() 这个不是释放资源的代码么?
2012年07月26日 09点07分
1
Dim B As Audio
Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox2.Click
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
If Label2.Text = 0 Then
B = New Audio(OpenFileDialog1.FileName)
B.Play()
Timer1.Enabled = True
Label2.Text = 100
Else
B.Dispose()
B = New Audio(OpenFileDialog1.FileName)
B.Play()
Timer1.Enabled = True
Label2.Text = 100 End If
End If
End Sub
为什么播放一首歌曲 消耗内存越来越多? 启动才5MB 最高 到50+MB了
而且 B.Dispose() 这个不是释放资源的代码么?