Entering text into site

I will have a web browser in my app and I want it to enter text into a textbox on the page, how would I do this, I am just making an app to restart my router.


Answer this question

Entering text into site

  • bshive

    dakota367 wrote:
    I will have a web browser in my app and I want it to enter text into a textbox on the page, how would I do this, I am just making an app to restart my router.

    This can be done. you need to try and get the element by ID, the textbox, then once found, set its text on the documentCompleted event.

    Example...

    private sub webbrowser_documentcompleted(byval sender as object, byval e as WebBrowserDocumentCompletedEventArgs) handled webbrowser.documentcompleted

    Dim theElement as HtmlElement = Me.webbrowser.Document.GetElementById("ControlName")

    if theElement is nothing = false then

    'we found the element. set the inner text

    theElement.InnerText = "my text"

    end if

    end sub

    does this help



  • nghianghesi

    You want a who to do a what now You want a web browser to enter text into a textbox on a page

    I've no idea where the text is coming from or really, what it is you're trying to do... Could you be more specific


  • Entering text into site