Use WebBrowser records

Source: Internet
Author: User

1. Create a new class and use the class to obtain the WebBrowser element.

public          HtmlElement GetElement_Name(WebBrowser wb,=         HtmlElement GetElement_Id(WebBrowser wb, =         HtmlElement GetElement_Index(WebBrowser wb,=         HtmlElement GetElement_Form(WebBrowser wb,=  CheckExistElement_Form(WebBrowser wb, = (e ==                             Write_value(HtmlElement e,          Btn_click(HtmlElement e,
Element el =), dt. rows [] [= (IHTMLElementCollection) doc2.all. tags (); IHTMLElementCollection = (IHTMLElementCollection) doc2.all. tags (); IHTMLElement elementsex = (IHTMLElement) input. item (, = (dt. rows [] []. toString () ====== IHTMLElement elementgroup_id = (IHTMLElement ). item (, = SelectElementgroup_id.value =]. raiseEvent (IHTMLDocument2 doc11 = (IHTMLDocument2) IDRWebBrowser. document. window. frames [=;

// If You Want To execute element events, such as onchange events, onclick events, and onblur events, you can use either of the following methods:
WebBrowser executes Javascript in the dom in two ways:
1. IDRWebBrowser. document. all ["B _year"]. raiseEvent ("onblur"); // execute the onblur event whose element name is 'B _ year'. If it is an onclick event, change it.
2. IDRWebBrowser. document. invokeScript ("changeDiseaseid1", new object [] {InputElementselDisease_1}); // execute the changeDiseaseid1 method, which is followed by parameters. There are many online explanations, I suggest using the first method, and the first one is easy to use.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.