在我的應用程序只有一個網頁瀏覽器和幾個定時器,但如果網頁瀏覽器加載,它使用的CPU的50%和AFER5分鐘周圍的120K RAM。我能做什麼?WebBrowser控件佔用太多的CPU和RAM
我的代碼:如果在控件加載一些沉重的網頁
Public Sub work()
WebBrowser1.Navigate("Site")
tim.Start()
End Sub
Public Sub work2()
WebBrowser1.Document.GetElementFromPoint(point).InvokeMember("click")
tim2.Start()
tim.Stop()
End Sub
Dim point As New Point(800, 30)
Dim WithEvents tim As New Timer
Dim WithEvents tim2 As New Timer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
tim.Interval = 6000
tim2.Interval = 6000
work()
End Sub
Private Sub tim_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tim.Tick
work2()
End Sub
Private Sub tim2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tim2.Tick
work()
End Sub
當然,它是120 *兆字節*? –