真正的人数与webbrowser

时间:2012-11-19 05:10:58

标签: webbrowser-control

我们有真正的人数AXI相机,计算进入大楼的人数。我们可以在网页上看到实时视图和\ out中的计数。我想在没有任何动画的屏幕上显示计数结果。我想在vb.net中使用webbrowser控件来加载实时视图网页,然后在webbrowser中注入javascript并在文本框上显示计数。这是我的代码,但我一直在javascript文本上收到错误消息,任何帮助升值

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Me.WebBrowser3.Navigate( “HTTP://10.xx.xxx.xx/people-counter/liveview.html”

Private Sub WebBrowser3_DocumentCompleted(ByVal sender As System.Object,ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)处理WebBrowser3.DocumentCompleted

    Dim mScript As HtmlElement
    Dim mHead As HtmlElement
    Dim element As mshtml.HTMLScriptElement


    With WebBrowser3
        mHead = WebBrowser3.Document.GetElementsByTagName("head")(0)
        mScript = .Document.CreateElement("script")
        mScript.SetAttribute("type", "text/javascript")
        element = mScript.DomElement
        element.text = "$(function showcount(){$("#video").countingArea($.extend({},cntarea,{displayWidth:320,displayHeight:240,mjpgUrl:"/axis-cgi/mjpg/video.cgi?resolution=320x240",jpegUrl:"/local/people-counter/.api?image.jpg",fps:12}));$.liveviewWithTable({countsTableElement:$("#counts"),countTableElement:$("#count"),directionIn:$.getParam("Counter.DirectionIn"),liveSumUrl:"/local/people-counter/.api?live-sum.json",loadingAnimationUrl:"/people-counter/images/ajax-loader.gif",dataTypes:["in","out"],strings:{"x second ago":"%d second ago","x seconds ago":"%d seconds ago","x minute ago":"%d minute ago","x minutes ago":"%d minutes ago","x hour ago":"%d hour ago","x hours ago":"%d hours ago","x day ago":"%d day ago","x days ago":"%d days ago","x week ago":"%d week ago","x weeks ago":"%d weeks ago","x month ago":"%d month ago","x months ago":"%d months ago","x year ago":"%d year ago","x years ago":"%d years ago"}})});"

        mHead.AppendChild(mScript)
        .Document.InvokeScript("showcount")
    End With
End Sub

0 个答案:

没有答案