IE Automatic Landing-navigate article

Source: Internet
Author: User
Tags html form http post

Earlier, because the project needs to do an automatic landing site ActiveX Plug-ins. The main function is to start an IE instance through this plugin or use the browser where the plugin resides,

Play a website (that is, through navigate navigation), through the IHTMLDocument2 interface to find the relevant elements, and fill in the corresponding value, the last simulation click the Landing button, complete the landing. This

The method is simple and theoretically belongs to simulated artificial landing, and the limitation is relatively small. But it has a disadvantage, is to open the landing page, fill in the value of the process, not directly into the landing

The post page looks more natural.

View Msdn,iwebbrowser2::navigate declaration again:

HRESULT Navigate (BSTR URL,

variant *flags,

variant *targetframename,

variant *postdata,< c4/> VARIANT *headers

);

The fourth parameter is PostData, that can be attached with postdata data directly into it? Look down

PostData:

[In] Pointer to data to send with the HTTP POST transaction. For example, the POST transaction be used to send data gathered

by an HTML form. If This parameter does is not specify any post data, iwebbrowser2::navigate issues a HTTP get transaction.

This means that specifying the PostData parameter is the same as submitting it through an HTML form. Of course it works.

The type of this parameter is VARIANT,MSDN:

The post data specified by PostData is passed as a SAFEARRAY data Type structure. The VARIANT should is of type vt_array and point

To a SAFEARRAY Data Type. The SAFEARRAY Data type should is of element Type vt_ui1, dimension one, and have an element count equal

To the number of bytes of post data.

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.