我有一个计时器,它每 5 分钟检查一次网页是否通过 Webbrowser 元素进行更改。每当页面更改(新订单)时,我的计时器将播放一个 .wav 文件(哔声)。这似乎在最初的几分钟或有时在最初的几个小时内有效,但随后它将停止检查而不会出现警告/异常。
什么可能导致这个问题?
编辑#1
这是我正在使用的代码:
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Dim sQuelltext As String = WebBrowser1.DocumentText.ToString
If Not String.IsNullOrEmpty(sQuelltext) And sQuelltext.Contains("pending") Then
My.Computer.Audio.Play(soundFile, AudioPlayMode.Background)
End If
End Sub